Support LSP based completion provider #243528
Conversation
src/vs/workbench/contrib/terminalContrib/suggest/browser/lspTerminalModelContentProvider.ts
Outdated
Show resolved
Hide resolved
|
TODO: activate language extension (python extensions, pylance) if installed when user types 'python' in terminal TODO: Need to figure out way to save successful commands in the virtual file so we get the correct completions in future prompts. |
…ictionaryService. Lots of TODOs
src/vs/workbench/contrib/terminalContrib/suggest/browser/lspCompletionProviderAddon.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/suggest/browser/terminal.suggest.contribution.ts
Outdated
Show resolved
Hide resolved
| private readonly _terminal: Terminal, | ||
| @ILogService private readonly _logService: ILogService | ||
| @ILogService private readonly _logService: ILogService, | ||
| @ILspTerminalDictionaryService private readonly _lspTerminalDictionaryService: ILspTerminalDictionaryService, |
There was a problem hiding this comment.
I don't think we want to inject this service here. Can you describe why this is needed? It would be best to encapsulate all lsp stuff in the provider addon.
src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/suggest/browser/terminal.suggest.contribution.ts
Outdated
Show resolved
Hide resolved
src/vs/platform/terminal/common/capabilities/lspTerminalDictionaryService.ts
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| if ( | ||
| this._ctx.instance.shellType !== GeneralShellType.Python && |
There was a problem hiding this comment.
could we create consts for all of these strings and keep them in lsp files? python, py, and ms-python...
There was a problem hiding this comment.
Great idea, just resolved this here: 58e810f
Also I removed check for this._ctx.instance.shellLaunchConfig.executable since it seems like its never Python but always upper shell. this._ctx.shellType would be enough check.
src/vs/workbench/contrib/terminalContrib/suggest/browser/lspCompletionProviderAddon.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/suggest/browser/lspTerminalModelContentProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/suggest/browser/terminal.suggest.contribution.ts
Outdated
Show resolved
Hide resolved
...rkbench/contrib/terminalContrib/suggest/test/browser/lspTerminalModelContentProvider.test.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/suggest/test/browser/terminalCompletionModel.test.ts
Show resolved
Hide resolved
meganrogge
left a comment
There was a problem hiding this comment.
Looks good, getting close!
|
I created this one file called lspTerminalUtil which basically contains all the const used for terminal-lsp related stuff. |
Resolves: #241167
Resolves: microsoft/vscode-python#24776
Note: I left several TODOs for when we eventually make this more generic (not too specific for Python)