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

vscode shows an extra definition location #37526

Closed
tempit opened this issue Nov 2, 2017 · 7 comments
Closed

vscode shows an extra definition location #37526

tempit opened this issue Nov 2, 2017 · 7 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@tempit
Copy link

tempit commented Nov 2, 2017

  • VSCode Version: 1.17.2
  • OS Version: Ubuntu 16.04

I'm writing an LSP based extension for our CSS preprocessor.
When implementing onDefinition I see that while I send one definition in the response, vscode shows 2.
The second location is the line on which the defintion request was sent.
This makes it harder to find the real definition, and prevents Ctrl+click from going directly to the location I send.
Am I missing something? As you can see in the pic, I am only sending one location back (line 7).

image

@vscodebot vscodebot bot added editor editor-contrib Editor collection of extras labels Nov 2, 2017
@octref octref removed editor editor-contrib Editor collection of extras labels Nov 2, 2017
@octref
Copy link
Contributor

octref commented Nov 2, 2017

The other definition is provided by vscode-css-languageservice.

@dbaeumer @aeschli I'm wondering if it's possible to disable built-in LS for particular files? I'm also interested in doing that.

@octref octref added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Nov 2, 2017
@tempit
Copy link
Author

tempit commented Nov 2, 2017

I second that question. Is it possible to disable CSS LS for certain files? In my case .st.css
Only way I found so far is to change our extension to .stcss so it isn't considered css, but then I lose highlighting, etc.
I'd like to be able to pass the CSS LS results through my server, so I can filter out/change some of them

@octref
Copy link
Contributor

octref commented Nov 2, 2017

My usecase is I'm writing a postcss LS and I want to have full control of LS features on *.css files for specific workspaces.

@dbaeumer
Copy link
Member

dbaeumer commented Nov 3, 2017

I am not aware of such a support.

@tempit
Copy link
Author

tempit commented Nov 5, 2017

Ok, thanks. Related question, then:
Is it possible to make .st.css files belong to my language and not to CSS? (By registering my language and associating the extension), or will it always be handled by CSS LS because .st.css ends with .css?

@octref
Copy link
Contributor

octref commented Nov 7, 2017

@dbaeumer There is also issues like microsoft/vscode-css-languageservice#47 that an option to disable CSS LS could help.

@aeschli
Copy link
Contributor

aeschli commented Nov 9, 2017

Yes, you can add a file assosciation in your extension (or the user settings). The most specific association wins:

    "files.associations": {
        "*.st.css": "mylanguage"
    }

@aeschli aeschli closed this as completed Nov 9, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants