Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in *debug* after triggering completion #2

Closed
jacobdufault opened this issue Feb 13, 2018 · 13 comments
Closed

Errors in *debug* after triggering completion #2

jacobdufault opened this issue Feb 13, 2018 · 13 comments

Comments

@jacobdufault
Copy link

From *debug*: error running command 'eval -client unnamed0 %{%sh{cat /tmp/tmp.UMDSQBtDZZ; rm /tmp/tmp.UMDSQBtDZZ}}': 1:1: 'eval' 1:1: 'set' not enough elements in tuple

Some output from main.ts:

{ session: '38471',
  client: 'unnamed0',
  message: 'set buffer=/usr/local/google/home/jdufault/test/fo.cc lsp_completions \'17.6@159:~Hello()|void ~Hello()|~Hello    {MenuInfo}Constructor:Hello\\\\:\\\\:|Hello\\\\:\\\\:|Hello     {MenuInfo}undefined:a|int a|a         {MenuInfo}Field:baaaaaa|int baaaaaa\n\nHello world|baaaaaa   {MenuInfo}Field:operator=(|Hello & operator=(const Hello &)|operator= {MenuInfo}Method\'' }
{ session: '38471',
  client: undefined,
  message: 'eval -client unnamed0 %{%sh{cat /tmp/tmp.5XeiDafxau; rm /tmp/tmp.5XeiDafxau}}' }
notification $cquery/progress [{"indexRequestCount":0,"doIdMapCount":0,"loadPreviousIndexCount":0,"onIdMappedCount":0,"onIndexedCount":0,"activeThreads":0}]
notification $cquery/progress [{"indexRequestCount":0,"doIdMapCount":0,"loadPreviousIndexCount":0,"onIdMappedCount":0,"onIndexedCount":0,"activeThreads":0}]
diagnostics file:///usr/local/google/home/jdufault/test/fo.cc
  { start: { line: 19, character: 2 },
    end: { line: 19, character: 2 } }
  expected unqualified-id
From kakoune on fifo: {"command":"lsp-complete","completers":"filename:word=all:option=lsp_completions","buffile":"/usr/local/google/home/jdufault/test/fo.cc","client":"unnamed0","ti (capped from 502 to 160 chars)
length 0: { line: '', i: 1 }
diagnostics file:///usr/local/google/home/jdufault/test/fo.cc
  { start: { line: 19, character: 2 },
    end: { line: 19, character: 2 } }
  expected unqualified-id
{ complete:
   { isIncomplete: false,
     items:
      [ { label: '~Hello',
          kind: 4,
          detail: 'void ~Hello()',
          documentation: '',
          sortText: '....p6',
          insertText: '~Hello()',
          insertTextFormat: 1 },
        { label: 'Hello',
          kind: 22,
          detail: 'Hello::',
          documentation: '',
          sortText: '..../9',
          insertText: 'Hello::',
          insertTextFormat: 1 },
        { label: 'a',
          kind: 5,
          detail: 'int a',
          documentation: '',
          sortText: '.....X',
          insertText: 'a',
          insertTextFormat: 1 },
        { label: 'baaaaaa',
          kind: 5,
          detail: 'int baaaaaa',
          documentation: 'Hello world',
          sortText: '.....X',
          insertText: 'baaaaaa',
          insertTextFormat: 1 },
        { label: 'operator=',
          kind: 2,
          detail: 'Hello & operator=(const Hello &)',
          documentation: '',
          sortText: '....p6',
          insertText: 'operator=(',
          insertTextFormat: 1 } ] } }
{ optname: 'lsp_completions',
  opt: 'option=lsp_completions',
  setup: '',
  rhs: '17.6@159:~Hello()|void ~Hello()|~Hello    {MenuInfo}Constructor:Hello\\\\:\\\\:|Hello\\\\:\\\\:|Hello     {MenuInfo}undefined:a|int a|a         {MenuInfo}Field:baaaaaa|int baaaaaa\n\nHello world|baaaaaa   {MenuInfo}Field:operator=(|Hello & operator=(const Hello &)|operator= {MenuInfo}Method' }
{ session: '38471',
  client: 'unnamed0',
  message: 'set buffer=/usr/local/google/home/jdufault/test/fo.cc lsp_completions \'17.6@159:~Hello()|void ~Hello()|~Hello    {MenuInfo}Constructor:Hello\\\\:\\\\:|Hello\\\\:\\\\:|Hello     {MenuInfo}undefined:a|int a|a         {MenuInfo}Field:baaaaaa|int baaaaaa\n\nHello world|baaaaaa   {MenuInfo}Field:operator=(|Hello & operator=(const Hello &)|operator= {MenuInfo}Method\'' }
{ session: '38471',
  client: undefined,
  message: 'eval -client unnamed0 %{%sh{cat /tmp/tmp.UMDSQBtDZZ; rm /tmp/tmp.UMDSQBtDZZ}}' }
notification $cquery/progress [{"indexRequestCount":0,"doIdMapCount":0,"loadPreviousIndexCount":0,"onIdMappedCount":0,"onIndexedCount":0,"activeThreads":0}]
notification $cquery/progress [{"indexRequestCount":0,"doIdMapCount":0,"loadPreviousIndexCount":0,"onIdMappedCount":0,"onIndexedCount":0,"activeThreads":0}]
diagnostics file:///usr/local/google/home/jdufault/test/fo.cc
  { start: { line: 19, character: 2 },
    end: { line: 19, character: 2 } }
  expected unqualified-id
@jacobdufault jacobdufault changed the title Failure to work with cquery Errors in *debug* Feb 13, 2018
@jacobdufault jacobdufault changed the title Errors in *debug* Errors in *debug* after triggering completion Feb 13, 2018
danr pushed a commit that referenced this issue Feb 13, 2018
@danr
Copy link
Owner

danr commented Feb 13, 2018

Ok, try again!

Note: you might need to issue set global completers '' so that the word and filename completers override the lsp completions.

@jacobdufault
Copy link
Author

I'm getting some completion results but there are various small issues, ie, duplicates are not shown.

{ complete:
   { isIncomplete: false,
     items:
      [ { label: 'foobar',
          kind: 2,
          detail: 'void foobar(int)',
          documentation: '',
          sortText: '...........',
          insertText: 'foobar(',
          filterText: 'foobar',
          insertTextFormat: 1 },
        { label: 'foobar',
          kind: 2,
          detail: 'void foobar(const char *)',
          documentation: '',
          sortText: '........../',
          insertText: 'foobar(',
          filterText: 'foobar',
          insertTextFormat: 1 },
        { label: 'Hello',
          kind: 22,
          detail: 'Hello::',
          documentation: '',
          sortText: '..........0',
          insertText: 'Hello::',
          filterText: 'Hello',
          insertTextFormat: 1 },
        { label: '~Hello',
          kind: 4,
          detail: 'void ~Hello()',
          documentation: '',
          sortText: '..........1',
          insertText: '~Hello()',
          filterText: '~Hello',
          insertTextFormat: 1 },
        { label: 'operator=',
          kind: 2,
          detail: 'Hello & operator=(const Hello &)',
          documentation: '',
          sortText: '..........2',
          insertText: 'operator=(',
          filterText: 'operator=',
          insertTextFormat: 1 } ] } }
{ session: '190141',
  client: 'unnamed0',
  message: 'set \'buffer=/usr/local/google/home/jdufault/test/fo.cc\' lsp_completions \'19.6@288:foobar(|void foobar(int)|foobar    {MenuInfo}Method:foobar(|void foobar(const char *)|foobar    {MenuInfo}Method:Hello\\:\\:|Hello\\:\\:|Hello     {MenuInfo}undefined:~Hello()|void
~Hello()|~Hello    {MenuInfo}Constructor:operator=(|Hello & operator=(const Hello &)|operator= {MenuInfo}Method\'' }
{ session: '190141',
  client: undefined,
  message: 'eval -client unnamed0 %{%sh{cat /tmp/tmp.F8VrNtOT1W; rm /tmp/tmp.F8VrNtOT1W}}' }

If you look you can see cquery is emitting foobar twice, with different detail strings. These should be shown as separate entries. Is this a kakoune bug?

It also looks like textEdit it not being honored.

@danr
Copy link
Owner

danr commented Feb 13, 2018

I did a little experiment and it seems like kakoune filters the candidates based on the insertText.

I think Kakoune lacks functionality to indicate clearly when a completion alternative was chosen, so I don't know when the TextEdit should occur. How is this usually handled in other editors?

@jacobdufault
Copy link
Author

jacobdufault commented Feb 13, 2018

I believe the text edit should happen on when the candidate is chosen, as you described. Perhaps kakoune itself needs to have that functionality added? I believe running code is supported when selecting a menu item.

Supporting textEdit is not that urgent, cquery has #include completion which relies on it but it should be fine it is is broken for a while.

@danr
Copy link
Owner

danr commented Feb 14, 2018

I believe running code is supported when selecting a menu item.

This is supported with the InsertCompletionSelect hook, which was requested for setting the completion menu with documentation for language servers that can provide this lazily.

I presume that the TextEdits are not idempotent so it will be problematic if we execute them every time an item is selected.

@jacobdufault
Copy link
Author

jacobdufault commented Feb 14, 2018

I think that the following message is not being sent to kakoune correctly (ie, missing escapes). Sorry for the large size - I decided to try using kakoune-languageclient + cquery on a non-toy project :)

{"jsonrpc":"2.0","id":1,"result":{"isIncomplete":true,"items":[{"label":"text","kind":6,"detail":"const base::string16 & text","documentation":"","sortText":"...........","insertText":"text","filterText":"text","insertTextFormat":1},{"label":"elided","kind":6,"detail":"base::string16 elided","documentation":"","sortText":"........../","insertText":"elided","filterText":"elided","insertTextFormat":1},{"label":"kMaximumStatusStringLength","kind":6,"detail":"const size_t kMaximumStatusStringLength","documentation":"","sortText":"..........0","insertText":"kMaximumStatusStringLength","filterText":"kMaximumStatusStringLength","insertTextFormat":1},{"label":"ElideString","kind":3,"detail":"base::string16 ElideString(const base::string16 &text)","documentation":"Helper method to elide the given string to the maximum length. If a string is contains user-input and is displayed, we should elide it. TODO(jdufault): This does not properly trim unicode characters. We should implement this properly by using views::Label::SetElideBehavior(...). See crbug.com/532496.","sortText":"..........1","insertText":"ElideString(","filterText":"ElideString","insertTextFormat":1},{"label":"kOverviewTextFilterSearchIcon","kind":6,"detail":"const gfx::VectorIcon kOverviewTextFilterSearchIcon","documentation":"","sortText":"..........2","insertText":"kOverviewTextFilterSearchIcon","filterText":"kOverviewTextFilterSearchIcon","insertTextFormat":1},{"label":"kPaletteModeMagnifyIcon","kind":6,"detail":"const gfx::VectorIcon kPaletteModeMagnifyIcon","documentation":"","sortText":"..........3","insertText":"kPaletteModeMagnifyIcon","filterText":"kPaletteModeMagnifyIcon","insertTextFormat":1},{"label":"ShelfItemStatus","kind":13,"detail":"ShelfItemStatus","documentation":"Represents the status of applications in the shelf.","sortText":"..........4","insertText":"ShelfItemStatus","filterText":"ShelfItemStatus","insertTextFormat":1},{"label":"ShelfID","kind":22,"detail":"ShelfID","documentation":"A unique shelf item id composed of an |app_id| and a |launch_id|. |app_id| is the non-empty application id associated with a set of windows. |launch_id| is passed on app launch, to support multiple shelf items per app. As an example, a remote desktop client may want each remote application to have its own icon.","sortText":"..........5","insertText":"ShelfID","filterText":"ShelfID","insertTextFormat":1},{"label":"ShelfID","kind":4,"detail":"ShelfID(const std::string &app_id = std::string(), const std::string &launch_id = std::string())","documentation":"","sortText":"..........6","insertText":"ShelfID(","filterText":"ShelfID","insertTextFormat":1},{"label":"ShelfID","kind":4,"detail":"ShelfID(const ash::ShelfID &other)","documentation":"","sortText":"..........7","insertText":"ShelfID(","filterText":"ShelfID","insertTextFormat":1},{"label":"ShelfID","kind":4,"detail":"ShelfID(ash::ShelfID &&other)","documentation":"","sortText":"..........8","insertText":"ShelfID(","filterText":"ShelfID","insertTextFormat":1},{"label":"kPaddingFromBottomOfScreenBottomAlignment","kind":6,"detail":"const int kPaddingFromBottomOfScreenBottomAlignment","documentation":"","sortText":"..........9","insertText":"kPaddingFromBottomOfScreenBottomAlignment","filterText":"kPaddingFromBottomOfScreenBottomAlignment","insertTextFormat":1},{"label":"kTrayPopupButtonEndMargin","kind":6,"detail":"const int kTrayPopupButtonEndMargin","documentation":"","sortText":"..........A","insertText":"kTrayPopupButtonEndMargin","filterText":"kTrayPopupButtonEndMargin","insertTextFormat":1},{"label":"kMenuSeparatorVerticalPadding","kind":6,"detail":"const int kMenuSeparatorVerticalPadding","documentation":"The vertical padding for the system menu separator.","sortText":"..........B","insertText":"kMenuSeparatorVerticalPadding","filterText":"kMenuSeparatorVerticalPadding","insertTextFormat":1},{"label":"kBubblePaddingVerticalSide","kind":6,"detail":"const int kBubblePaddingVerticalSide","documentation":"","sortText":"..........C","insertText":"kBubblePaddingVerticalSide","filterText":"kBubblePaddingVerticalSide","insertTextFormat":1},{"label":"TrayEnterprise","kind":7,"detail":"TrayEnterprise","documentation":"","sortText":"..........D","insertText":"TrayEnterprise","filterText":"TrayEnterprise","insertTextFormat":1},{"label":"kSystemTrayAccessibilityIcon","kind":6,"detail":"const gfx::VectorIcon kSystemTrayAccessibilityIcon","documentation":"","sortText":"..........E","insertText":"kSystemTrayAccessibilityIcon","filterText":"kSystemTrayAccessibilityIcon","insertTextFormat":1},{"label":"kNetworkBadgeSecureIcon","kind":6,"detail":"const gfx::VectorIcon kNetworkBadgeSecureIcon","documentation":"","sortText":"..........F","insertText":"kNetworkBadgeSecureIcon","filterText":"kNetworkBadgeSecureIcon","insertTextFormat":1},{"label":"UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED","kind":20,"detail":"ash::UserMetricsAction UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED","documentation":"","sortText":"..........G","insertText":"UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED","filterText":"UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED","insertTextFormat":1},{"label":"LockStateObserver","kind":7,"detail":"LockStateObserver","documentation":"Interface for classes that want to be notified by LockStateController when session-related events occur.","sortText":"..........H","insertText":"LockStateObserver","filterText":"LockStateObserver","insertTextFormat":1},{"label":"kTrayBubbleAnchorTopInsetBottomAnchor","kind":6,"detail":"const int kTrayBubbleAnchorTopInsetBottomAnchor","documentation":"","sortText":"..........I","insertText":"kTrayBubbleAnchorTopInsetBottomAnchor","filterText":"kTrayBubbleAnchorTopInsetBottomAnchor","insertTextFormat":1},{"label":"kSystemMenuAccessibilityAutoClickIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuAccessibilityAutoClickIcon","documentation":"","sortText":"..........J","insertText":"kSystemMenuAccessibilityAutoClickIcon","filterText":"kSystemMenuAccessibilityAutoClickIcon","insertTextFormat":1},{"label":"tray","kind":9,"detail":"tray::","documentation":"","sortText":"..........K","insertText":"tray::","filterText":"tray","insertTextFormat":1},{"label":"kSystemMenuCastAudioIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuCastAudioIcon","documentation":"","sortText":"..........L","insertText":"kSystemMenuCastAudioIcon","filterText":"kSystemMenuCastAudioIcon","insertTextFormat":1},{"label":"kTrayEdgePadding","kind":6,"detail":"const int kTrayEdgePadding","documentation":"The total visual padding at the start and end of the icon/label section of the tray.","sortText":"..........M","insertText":"kTrayEdgePadding","filterText":"kTrayEdgePadding","insertTextFormat":1},{"label":"kPaletteActionCaptureScreenIcon","kind":6,"detail":"const gfx::VectorIcon kPaletteActionCaptureScreenIcon","documentation":"","sortText":"..........N","insertText":"kPaletteActionCaptureScreenIcon","filterText":"kPaletteActionCaptureScreenIcon","insertTextFormat":1},{"label":"kMenuButtonSize","kind":6,"detail":"const int kMenuButtonSize","documentation":"The size of buttons in the system menu.","sortText":"..........O","insertText":"kMenuButtonSize","filterText":"kMenuButtonSize","insertTextFormat":1},{"label":"SHELF_ALIGNMENT_RIGHT","kind":20,"detail":"ash::ShelfAlignment SHELF_ALIGNMENT_RIGHT","documentation":"","sortText":"..........P","insertText":"SHELF_ALIGNMENT_RIGHT","filterText":"SHELF_ALIGNMENT_RIGHT","insertTextFormat":1},{"label":"SystemTray","kind":7,"detail":"SystemTray","documentation":"For historical reasons, SystemTray is both a controller and a view. It manages all the SystemTrayItem controllers, creates icon views that appear in the tray, creates the bubble menu and fills the menu with items. It is also the view that contains the icons in the tray.","sortText":"..........Q","insertText":"SystemTray","filterText":"SystemTray","insertTextFormat":1},{"label":"SystemTray","kind":4,"detail":"SystemTray(ash::Shelf *shelf)","documentation":"","sortText":"..........R","insertText":"SystemTray(","filterText":"SystemTray","insertTextFormat":1},{"label":"SystemTray","kind":4,"detail":"SystemTray(const ash::SystemTray &)","documentation":"","sortText":"..........S","insertText":"SystemTray(","filterText":"SystemTray","insertTextFormat":1},{"label":"LoginStatus","kind":13,"detail":"LoginStatus","documentation":"","sortText":"..........T","insertText":"LoginStatus","filterText":"LoginStatus","insertTextFormat":1},{"label":"WallpaperControllerObserver","kind":7,"detail":"WallpaperControllerObserver","documentation":"","sortText":"..........U","insertText":"WallpaperControllerObserver","filterText":"WallpaperControllerObserver","insertTextFormat":1},{"label":"kTrayPopupSystemInfoRowHeight","kind":6,"detail":"const int kTrayPopupSystemInfoRowHeight","documentation":"The height of the system info row.","sortText":"..........V","insertText":"kTrayPopupSystemInfoRowHeight","filterText":"kTrayPopupSystemInfoRowHeight","insertTextFormat":1},{"label":"FirstRunHelper","kind":7,"detail":"FirstRunHelper","documentation":"","sortText":"..........W","insertText":"FirstRunHelper","filterText":"FirstRunHelper","insertTextFormat":1},{"label":"kPaddingFromInnerEdgeOfLauncherVerticalAlignment","kind":6,"detail":"const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment","documentation":"","sortText":"..........X","insertText":"kPaddingFromInnerEdgeOfLauncherVerticalAlignment","filterText":"kPaddingFromInnerEdgeOfLauncherVerticalAlignment","insertTextFormat":1},{"label":"kSystemMenuKeyboardIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuKeyboardIcon","documentation":"","sortText":"..........Y","insertText":"kSystemMenuKeyboardIcon","filterText":"kSystemMenuKeyboardIcon","insertTextFormat":1},{"label":"kShelfAddPersonButtonIcon","kind":6,"detail":"const gfx::VectorIcon kShelfAddPersonButtonIcon","documentation":"","sortText":"..........Z","insertText":"kShelfAddPersonButtonIcon","filterText":"kShelfAddPersonButtonIcon","insertTextFormat":1},{"label":"kNetworkBadgeTechnology1xIcon","kind":6,"detail":"const gfx::VectorIcon kNetworkBadgeTechnology1xIcon","documentation":"","sortText":"..........a","insertText":"kNetworkBadgeTechnology1xIcon","filterText":"kNetworkBadgeTechnology1xIcon","insertTextFormat":1},{"label":"kNetworkBadgeTechnologyEvdoIcon","kind":6,"detail":"const gfx::VectorIcon kNetworkBadgeTechnologyEvdoIcon","documentation":"","sortText":"..........b","insertText":"kNetworkBadgeTechnologyEvdoIcon","filterText":"kNetworkBadgeTechnologyEvdoIcon","insertTextFormat":1},{"label":"kNotificationCapslockIcon","kind":6,"detail":"const gfx::VectorIcon kNotificationCapslockIcon","documentation":"","sortText":"..........c","insertText":"kNotificationCapslockIcon","filterText":"kNotificationCapslockIcon","insertTextFormat":1},{"label":"TrayNetwork","kind":7,"detail":"TrayNetwork","documentation":"","sortText":"..........d","insertText":"TrayNetwork","filterText":"TrayNetwork","insertTextFormat":1},{"label":"kPaletteTrayIconMetalayerIcon","kind":6,"detail":"const gfx::VectorIcon kPaletteTrayIconMetalayerIcon","documentation":"","sortText":"..........e","insertText":"kPaletteTrayIconMetalayerIcon","filterText":"kPaletteTrayIconMetalayerIcon","insertTextFormat":1},{"label":"kPaddingFromOuterEdgeOfLauncherVerticalAlignment","kind":6,"detail":"const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment","documentation":"","sortText":"..........f","insertText":"kPaddingFromOuterEdgeOfLauncherVerticalAlignment","filterText":"kPaddingFromOuterEdgeOfLauncherVerticalAlignment","insertTextFormat":1},{"label":"kNetworkBadgeTechnology3gIcon","kind":6,"detail":"const gfx::VectorIcon kNetworkBadgeTechnology3gIcon","documentation":"","sortText":"..........g","insertText":"kNetworkBadgeTechnology3gIcon","filterText":"kNetworkBadgeTechnology3gIcon","insertTextFormat":1},{"label":"ScreenTrayItem","kind":7,"detail":"ScreenTrayItem","documentation":"The base tray item for screen capture and screen sharing. The Start method brings up a notification and a tray item, and the user can stop the screen capture/sharing by pressing the stop button.","sortText":"..........h","insertText":"ScreenTrayItem","filterText":"ScreenTrayItem","insertTextFormat":1},{"label":"ScreenTrayItem","kind":4,"detail":"ScreenTrayItem(ash::SystemTray *system_tray, ash::SystemTrayItem::UmaType uma_type)","documentation":"","sortText":"..........i","insertText":"ScreenTrayItem(","filterText":"ScreenTrayItem","insertTextFormat":1},{"label":"ScreenTrayItem","kind":4,"detail":"ScreenTrayItem(const ash::ScreenTrayItem &)","documentation":"","sortText":"..........j","insertText":"ScreenTrayItem(","filterText":"ScreenTrayItem","insertTextFormat":1},{"label":"kNotificationScreenshareIcon","kind":6,"detail":"const gfx::VectorIcon kNotificationScreenshareIcon","documentation":"","sortText":"..........k","insertText":"kNotificationScreenshareIcon","filterText":"kNotificationScreenshareIcon","insertTextFormat":1},{"label":"kCheckCircleIcon","kind":6,"detail":"const gfx::VectorIcon kCheckCircleIcon","documentation":"","sortText":"..........l","insertText":"kCheckCircleIcon","filterText":"kCheckCircleIcon","insertTextFormat":1},{"label":"kNetworkBadgeTechnologyGprsIcon","kind":6,"detail":"const gfx::VectorIcon kNetworkBadgeTechnologyGprsIcon","documentation":"","sortText":"..........m","insertText":"kNetworkBadgeTechnologyGprsIcon","filterText":"kNetworkBadgeTechnologyGprsIcon","insertTextFormat":1},{"label":"kTrayPopupInkDropRippleOpacity","kind":6,"detail":"const float kTrayPopupInkDropRippleOpacity","documentation":"The opacity of the ink drop ripples for all ink drops in the system menu.","sortText":"..........n","insertText":"kTrayPopupInkDropRippleOpacity","filterText":"kTrayPopupInkDropRippleOpacity","insertTextFormat":1},{"label":"TrayTiles","kind":7,"detail":"TrayTiles","documentation":"","sortText":"..........o","insertText":"TrayTiles","filterText":"TrayTiles","insertTextFormat":1},{"label":"UMA_LAUNCHER_MINIMIZE_TASK","kind":20,"detail":"ash::UserMetricsAction UMA_LAUNCHER_MINIMIZE_TASK","documentation":"","sortText":"..........p","insertText":"UMA_LAUNCHER_MINIMIZE_TASK","filterText":"UMA_LAUNCHER_MINIMIZE_TASK","insertTextFormat":1},{"label":"TrayCapsLock","kind":7,"detail":"TrayCapsLock","documentation":"","sortText":"..........q","insertText":"TrayCapsLock","filterText":"TrayCapsLock","insertTextFormat":1},{"label":"SHELF_AUTO_HIDE_BEHAVIOR_NEVER","kind":20,"detail":"ash::ShelfAutoHideBehavior SHELF_AUTO_HIDE_BEHAVIOR_NEVER","documentation":"Never auto-hide.","sortText":"..........r","insertText":"SHELF_AUTO_HIDE_BEHAVIOR_NEVER","filterText":"SHELF_AUTO_HIDE_BEHAVIOR_NEVER","insertTextFormat":1},{"label":"Config","kind":13,"detail":"Config","documentation":"","sortText":"..........s","insertText":"Config","filterText":"Config","insertTextFormat":1},{"label":"kTrayPopupItemMinHeight","kind":6,"detail":"const int kTrayPopupItemMinHeight","documentation":"The minimum/default height of the rows in the system tray menu.","sortText":"..........t","insertText":"kTrayPopupItemMinHeight","filterText":"kTrayPopupItemMinHeight","insertTextFormat":1},{"label":"kTrayPopupItemMinEndWidth","kind":6,"detail":"const int kTrayPopupItemMinEndWidth","documentation":"The width used for the end region of the row (usually a more arrow).","sortText":"..........u","insertText":"kTrayPopupItemMinEndWidth","filterText":"kTrayPopupItemMinEndWidth","insertTextFormat":1},{"label":"kTrayPopupMaxWidth","kind":6,"detail":"const int kTrayPopupMaxWidth","documentation":"","sortText":"..........v","insertText":"kTrayPopupMaxWidth","filterText":"kTrayPopupMaxWidth","insertTextFormat":1},{"label":"kPaletteActionCreateNoteIcon","kind":6,"detail":"const gfx::VectorIcon kPaletteActionCreateNoteIcon","documentation":"","sortText":"..........w","insertText":"kPaletteActionCreateNoteIcon","filterText":"kPaletteActionCreateNoteIcon","insertTextFormat":1},{"label":"kTrayActionNewLockScreenNoteIcon","kind":6,"detail":"const gfx::VectorIcon kTrayActionNewLockScreenNoteIcon","documentation":"","sortText":"..........x","insertText":"kTrayActionNewLockScreenNoteIcon","filterText":"kTrayActionNewLockScreenNoteIcon","insertTextFormat":1},{"label":"kNotificationKeyboardIcon","kind":6,"detail":"const gfx::VectorIcon kNotificationKeyboardIcon","documentation":"","sortText":"..........y","insertText":"kNotificationKeyboardIcon","filterText":"kNotificationKeyboardIcon","insertTextFormat":1},{"label":"kSystemMenuGuestIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuGuestIcon","documentation":"","sortText":"..........z","insertText":"kSystemMenuGuestIcon","filterText":"kSystemMenuGuestIcon","insertTextFormat":1},{"label":"kShelfLogoutIcon","kind":6,"detail":"const gfx::VectorIcon kShelfLogoutIcon","documentation":"","sortText":"........./.","insertText":"kShelfLogoutIcon","filterText":"kShelfLogoutIcon","insertTextFormat":1},{"label":"STATUS_ATTENTION","kind":20,"detail":"ash::ShelfItemStatus STATUS_ATTENTION","documentation":"A shelf item that needs user's attention.","sortText":".........//","insertText":"STATUS_ATTENTION","filterText":"STATUS_ATTENTION","insertTextFormat":1},{"label":"kBubblePaddingHorizontalBottom","kind":6,"detail":"const int kBubblePaddingHorizontalBottom","documentation":"","sortText":"........./0","insertText":"kBubblePaddingHorizontalBottom","filterText":"kBubblePaddingHorizontalBottom","insertTextFormat":1},{"label":"kTrayIconSize","kind":6,"detail":"const int kTrayIconSize","documentation":"The size and foreground color of the icons appearing in the material design system tray.","sortText":"........./1","insertText":"kTrayIconSize","filterText":"kTrayIconSize","insertTextFormat":1},{"label":"AnimationChangeType","kind":13,"detail":"AnimationChangeType","documentation":"","sortText":"........./2","insertText":"AnimationChangeType","filterText":"AnimationChangeType","insertTextFormat":1},{"label":"kShelfBackIcon","kind":6,"detail":"const gfx::VectorIcon kShelfBackIcon","documentation":"","sortText":"........./3","insertText":"kShelfBackIcon","filterText":"kShelfBackIcon","insertTextFormat":1},{"label":"kSystemMenuTracingIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuTracingIcon","documentation":"","sortText":"........./4","insertText":"kSystemMenuTracingIcon","filterText":"kSystemMenuTracingIcon","insertTextFormat":1},{"label":"kTrayPopupPaddingBetweenItems","kind":6,"detail":"const int kTrayPopupPaddingBetweenItems","documentation":"","sortText":"........./5","insertText":"kTrayPopupPaddingBetweenItems","filterText":"kTrayPopupPaddingBetweenItems","insertTextFormat":1},{"label":"ShelfAction","kind":13,"detail":"ShelfAction","documentation":"The actions that may be performed when a shelf item is selected.","sortText":"........./6","insertText":"ShelfAction","filterText":"ShelfAction","insertTextFormat":1},{"label":"kTouchCalibrationCompleteCheckIcon","kind":6,"detail":"const gfx::VectorIcon kTouchCalibrationCompleteCheckIcon","documentation":"","sortText":"........./7","insertText":"kTouchCalibrationCompleteCheckIcon","filterText":"kTouchCalibrationCompleteCheckIcon","insertTextFormat":1},{"label":"kSystemMenuNightLightOnIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuNightLightOnIcon","documentation":"","sortText":"........./8","insertText":"kSystemMenuNightLightOnIcon","filterText":"kSystemMenuNightLightOnIcon","insertTextFormat":1},{"label":"UMA_STATUS_AREA_DETAILED_CAST_VIEW_LAUNCH_CAST","kind":20,"detail":"ash::UserMetricsAction UMA_STATUS_AREA_DETAILED_CAST_VIEW_LAUNCH_CAST","documentation":"","sortText":"........./9","insertText":"UMA_STATUS_AREA_DETAILED_CAST_VIEW_LAUNCH_CAST","filterText":"UMA_STATUS_AREA_DETAILED_CAST_VIEW_LAUNCH_CAST","insertTextFormat":1},{"label":"ShelfLayoutManager","kind":7,"detail":"ShelfLayoutManager","documentation":"","sortText":"........./A","insertText":"ShelfLayoutManager","filterText":"ShelfLayoutManager","insertTextFormat":1},{"label":"UMA_SHELF_ALIGNMENT_SET_RIGHT","kind":20,"detail":"ash::UserMetricsAction UMA_SHELF_ALIGNMENT_SET_RIGHT","documentation":"","sortText":"........./B","insertText":"UMA_SHELF_ALIGNMENT_SET_RIGHT","filterText":"UMA_SHELF_ALIGNMENT_SET_RIGHT","insertTextFormat":1},{"label":"SystemTrayBubble","kind":7,"detail":"SystemTrayBubble","documentation":"","sortText":"........./C","insertText":"SystemTrayBubble","filterText":"SystemTrayBubble","insertTextFormat":1},{"label":"SystemTrayBubble","kind":4,"detail":"SystemTrayBubble(ash::SystemTray *tray)","documentation":"","sortText":"........./D","insertText":"SystemTrayBubble(","filterText":"SystemTrayBubble","insertTextFormat":1},{"label":"SystemTrayBubble","kind":4,"detail":"SystemTrayBubble(const ash::SystemTrayBubble &)","documentation":"","sortText":"........./E","insertText":"SystemTrayBubble(","filterText":"SystemTrayBubble","insertTextFormat":1},{"label":"TrayItemView","kind":7,"detail":"TrayItemView","documentation":"Base-class for items in the tray. It makes sure the widget is updated correctly when the visibility/size of the tray item changes. It also adds animation when showing/hiding the item in the tray.","sortText":"........./F","insertText":"TrayItemView","filterText":"TrayItemView","insertTextFormat":1},{"label":"TrayItemView","kind":4,"detail":"TrayItemView(ash::SystemTrayItem *owner)","documentation":"","sortText":"........./G","insertText":"TrayItemView(","filterText":"TrayItemView","insertTextFormat":1},{"label":"TrayItemView","kind":4,"detail":"TrayItemView(const ash::TrayItemView &)","documentation":"","sortText":"........./H","insertText":"TrayItemView(","filterText":"TrayItemView","insertTextFormat":1},{"label":"kNotificationButtonWidth","kind":6,"detail":"const int kNotificationButtonWidth","documentation":"","sortText":"........./I","insertText":"kNotificationButtonWidth","filterText":"kNotificationButtonWidth","insertTextFormat":1},{"label":"kNotificationScreenIcon","kind":6,"detail":"const gfx::VectorIcon kNotificationScreenIcon","documentation":"","sortText":"........./J","insertText":"kNotificationScreenIcon","filterText":"kNotificationScreenIcon","insertTextFormat":1},{"label":"UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW","kind":20,"detail":"ash::UserMetricsAction UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW","documentation":"","sortText":"........./K","insertText":"UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW","filterText":"UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW","insertTextFormat":1},{"label":"kSystemMenuPowerIcon","kind":6,"detail":"const gfx::VectorIcon kSystemMenuPowerIcon","documentation":"","sortText":"........./L","insertText":"kSystemMenuPowerIcon","filterText":"kSystemMenuPowerIcon","insertTextFormat":1},{"label":"kLockScreenAlertIcon","kind":6,"detail":"const gfx::VectorIcon kLockScreenAlertIcon","documentation":"","sortText":"........./M","insertText":"kLockScreenAlertIcon","filterText":"kLockScreenAlertIcon","insertTextFormat":1},{"label":"SessionObserver","kind":7,"detail":"SessionObserver","documentation":"","sortText":"........./N","insertText":"SessionObserver","filterText":"SessionObserver","insertTextFormat":1},{"label":"kShelfUnlockButtonIcon","kind":6,"detail":"const gfx::VectorIcon kShelfUnlockButtonIcon","documentation":"","sortText":"........./O","insertText":"kShelfUnlockButtonIcon","filterText":"kShelfUnlockButtonIcon","insertTextFormat":1},{"label":"TrayItemMore","kind":7,"detail":"TrayItemMore","documentation":"A view with a more arrow on the right edge. Clicking on the view brings up the detailed view of the tray-item that owns it. If the view is disabled, it will not show the more arrow.","sortText":"........./P","insertText":"TrayItemMore","filterText":"TrayItemMore","insertTextFormat":1},{"label":"TrayItemMore","kind":4,"detail":"TrayItemMore(ash::SystemTrayItem *owner)","documentation":"","sortText":"........./Q","insertText":"TrayItemMore(","filterText":"TrayItemMore","insertTextFormat":1},{"label":"TrayItemMore","kind":4,"detail":"TrayItemMore(const ash::TrayItemMore &)","documentation":"","sortText":"........./R","insertText":"TrayItemMore(","filterText":"TrayItemMore","insertTextFormat":1},{"label":"UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED","kind":20,"detail":"ash::UserMetricsAction UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED","documentation":"","sortText":"........./S","insertText":"UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED","filterText":"UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED","insertTextFormat":1},{"label":"UMA_STATUS_AREA_CAPS_LOCK_DETAILED","kind":20,"detail":"ash::UserMetricsAction UMA_STATUS_AREA_CAPS_LOCK_DETAILED","documentation":"","sortText":"........./T","insertText":"UMA_STATUS_AREA_CAPS_LOCK_DETAILED","filterText":"UMA_STATUS_AREA_CAPS_LOCK_DETAILED","insertTextFormat":1},{"label":"kBubblePaddingHorizontalSide","kind":6,"detail":"const int kBubblePaddingHorizontalSide","documentation":"","sortText":"........./U","insertText":"kBubblePaddingHorizontalSide","filterText":"kBubblePaddingHorizontalSide","insertTextFormat":1},{"label":"kPaletteModeMetalayerIcon","kind":6,"detail":"const gfx::VectorIcon kPaletteModeMetalayerIcon","documentation":"","sortText":"........./V","insertText":"kPaletteModeMetalayerIcon","filterText":"kPaletteModeMetalayerIcon","insertTextFormat":1},{"label":"TYPE_UNDEFINED","kind":20,"detail":"ash::ShelfItemType TYPE_UNDEFINED","documentation":"Default value.","sortText":"........./W","insertText":"TYPE_UNDEFINED","filterText":"TYPE_UNDEFINED","insertTextFormat":1},{"label":"kNotificationChargingUsbCIcon","kind":6,"detail":"const gfx::VectorIcon kNotificationChargingUsbCIcon","documentation":"","sortText":"........./X","insertText":"kNotificationChargingUsbCIcon","filterText":"kNotificationChargingUsbCIcon","insertTextFormat":1}]}}

Is there a good way for me to feed this message into the lib? I can test if so.
FWIW cquery has some nice debugging features when integrating/developing new frontends like recording all stdin/stdout.

@danr
Copy link
Owner

danr commented Feb 15, 2018

Interesting. Perhaps it would be useful to provide debugging alternatives of functions taking recorded results as arguments? Then one could do:

:debug-lsp-complete %sh{ cat recorded-reply.json }

This would bypass asking the server for an answer and just use the user-supplied directly instead.

@danr
Copy link
Owner

danr commented Feb 18, 2018

It's now possible to put a json object in the yank register and issue a corresponding debug-lsp-* command, like so:

:reg '"' "%sh{ cat recorded-reply.json }"; debug-lsp-complete
:reg '"' "%sh{ xclip -o }"; debug-lsp-complete

@danr
Copy link
Owner

danr commented Feb 18, 2018

I am able to use your completions this way.

@jacobdufault
Copy link
Author

Using debug-lsp-completions I've reduced it to the following example. It looks like single quotes are not being escaped.

{
  "isIncomplete": false,
  "items": [
    {
      "label": "AAAAAAA2'"
    }
  ]
}

@jacobdufault
Copy link
Author

jacobdufault commented Feb 20, 2018

set 'buffer=/foo.cc' lsp_completions '1.1@289:AAAAAAA2\'||AAAAAAA2' {MenuInfo}'

The second AAAAAAA2 is not escaped.

@jacobdufault
Copy link
Author

Replacing quote with this fixes the issue (ie, doing global replacements instead of only the first occurrence).

export function quote(msg: string) {
  // https://github.com/mawww/kakoune/issues/1049
  return (
    "'" +
    msg
      .replace(/\\'/g, "\\\\'")
      .replace(/\'/g, "\\'")
      .replace(/\\*$/g, '') +
    "'"
  )
}

@danr danr closed this as completed in 8c3f733 Feb 21, 2018
@danr
Copy link
Owner

danr commented Feb 21, 2018

Thanks. I will have to revisit that quoting since it's unnecessarily complicated because of mawww/kakoune#1049.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants