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

Alternative way for providing debug configuration snippets #4891

Closed
xisui-MSFT opened this issue Jan 24, 2020 · 4 comments
Closed

Alternative way for providing debug configuration snippets #4891

xisui-MSFT opened this issue Jan 24, 2020 · 4 comments
Assignees

Comments

@xisui-MSFT
Copy link
Collaborator

Type: Debugger

Because of the implementation (src/debugger/extension.ts, line 129 - 136), the intellisense for the snippets will be shown

  1. For all launch.json, at all locations
  2. Under multi-root mode, not at all for workspace configuration file (.code-workspace).
@pieandcakes
Copy link
Contributor

@WardenGnaw It is this line. Do you know why we need the actual launch.json file?

@WardenGnaw
Copy link
Member

registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable

We need to provide a document selector when we register the completion item provider for launch.json. This hooks into the Add Configurations... button displayed.

@xisui-MSFT
Copy link
Collaborator Author

There are two parts for providing a debug config https://vscode.readthedocs.io/en/latest/extensions/example-debuggers/, one is provideDebugConfigurations which provide the initial settings (or specifying initialConfigurations in package.json), and the other is to specify configurationSnippets, which provides the autocomplete stuff. Instead of the "standard" second part, you used a way to just insert to anywhere in the document as long as it's a launch.json file and intellisense pops up. So I doubt the problem you mentioned is the same.

While it's unfortunate that cpptools can't really use the package.json ways since there are some os dependent items, it looks like function provideCompletionItems does pass in a position argument. Can you change the function to check if it's triggered at a proper position?

For multi-root workspace file, it remains to be tested. But adding a document select for .code-workspace file would probably work?

@github-actions
Copy link

github-actions bot commented Dec 9, 2020

This issue has been closed automatically because it's labeled as 'external'.

@github-actions github-actions bot closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants