-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement codeLens #209
base: staging
Are you sure you want to change the base?
Implement codeLens #209
Conversation
}, | ||
"bitbake.enableCodeLensReferencesOnFunctions": { | ||
"type": "boolean", | ||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with CodeLens. So you're disabling it by default on purpose, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this surprised me also. However since currently we only have code lens for references, which have their dedicated button, I'm not sure the feature adds much value right now. Meanwhile it would bloat the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This demo is cool however I think codelenses are justified when we have specific commands to run. There are few extensions doing so and the additional buttons could annoy users. A useful example for instance is the git extension which adds additional commands for comparing with other branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would need different commands in order for this to be useful. I cannot think of one that isn't already seemlessly integrated into the interface yet (value hovers, rename, definitions, references...).
server/src/server.ts
Outdated
@@ -148,6 +153,37 @@ disposables.push( | |||
analyzer.clearRecipeLocalFiles() | |||
}), | |||
|
|||
connection.onCodeLens(async (params): Promise<LSP.CodeLens[]> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you'd like to put this into a onCodeLens
file in connectionHandlers
, but this works too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, like we do other feature handlers, it would be nice to have a dedicated file for separating features.
ae1a255
to
fca3f74
Compare
}, | ||
"bitbake.enableCodeLensReferencesOnFunctions": { | ||
"type": "boolean", | ||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this surprised me also. However since currently we only have code lens for references, which have their dedicated button, I'm not sure the feature adds much value right now. Meanwhile it would bloat the interface.
}, | ||
"bitbake.enableCodeLensReferencesOnFunctions": { | ||
"type": "boolean", | ||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This demo is cool however I think codelenses are justified when we have specific commands to run. There are few extensions doing so and the additional buttons could annoy users. A useful example for instance is the git extension which adds additional commands for comparing with other branches.
server/src/server.ts
Outdated
@@ -148,6 +153,37 @@ disposables.push( | |||
analyzer.clearRecipeLocalFiles() | |||
}), | |||
|
|||
connection.onCodeLens(async (params): Promise<LSP.CodeLens[]> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, like we do other feature handlers, it would be nice to have a dedicated file for separating features.
}, | ||
"bitbake.enableCodeLensReferencesOnFunctions": { | ||
"type": "boolean", | ||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would need different commands in order for this to be useful. I cannot think of one that isn't already seemlessly integrated into the interface yet (value hovers, rename, definitions, references...).
1816ee0
to
2644a34
Compare
I moved onCodeLens to its own file and rebased so we don't have to wait for Ziwei to merge |
2644a34
to
2805fa7
Compare
Added a simple codeLens for function references and a setting to control this behaviour.
Ticket: 14622