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

lsp-sample does not work #1083

Closed
hak33m16 opened this issue Aug 3, 2024 · 3 comments
Closed

lsp-sample does not work #1083

hak33m16 opened this issue Aug 3, 2024 · 3 comments
Assignees

Comments

@hak33m16
Copy link

hak33m16 commented Aug 3, 2024

Extension sample

lsp-sample

VS Code version

1.92.0

What went wrong?

The autocomplete and analysis that's supposed to be provided by the lsp-sample extension does not work

If you follow the instructions outlined in the README

  • There are no such autocomplete options available on a brand new plain text document in the Extension Development Host window
  • Entering text content does not emit any diagnostics

Here you can see it built perfectly fine, and in a brand new plain text document I have no autocomplete options:
Screenshot 2024-08-03 152018

VSCode: 1.92.0
Node: v22.5.1
npm: 10.8.2
Windows 11:

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      22631  0
@dbaeumer
Copy link
Member

dbaeumer commented Aug 7, 2024

Works for me.

Image

Please note the code completion and errors are generated for plain txt files only that exist on disk. See https://github.com/microsoft/vscode-extension-samples/blob/main/lsp-sample/client/src/extension.ts#L37

So it doesn't work for untitled files.

@dbaeumer dbaeumer closed this as completed Aug 7, 2024
@hak33m16
Copy link
Author

hak33m16 commented Aug 9, 2024

Please note the code completion and errors are generated for plain txt files only that exist on disk

Interesting, it does appear to work if I save the file to disk. That's unexpected behavior in my opinion, given that the format in the bottom right of a new untitled file that's yet to be saved is "plaintext". Thanks for clarifying

@dbaeumer
Copy link
Member

@hak33m16 you can provide support for unsaved files as well. Simple define a document selector that includes a filter with the untitled scheme or with a * scheme.

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

3 participants