You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I am developing a plugin, and I'm not sure if I'm doing things the correct way.
Mainly, I just want to provide additional documentation for certain methods or symbols.
As a first step, I was trying to simply show a tooltip on hover. I created a pin for a token in the AST, and added a random doc string.
I couldn't seem to get anything to show up in the VS Code extension.
I verified that
The plugin was loaded properly
The plugin was adding a valid pin
Whenever solargraph looked for definitions given a cursor position, I noticed that the source_map pins that it looked for did not include the pin that my plugin added.
I was able to resolve this by having SourceMap::Clip#define also consider the pins of the source_map's environment: source_map.environ.pins.
More specifically, I changed the line that I linked to above to be the following:
I made this change since all the Pins added by Conventions are stored on the source_map's environ property, but not on the source_map's pins attr. (See: here)
To me, this seems like expected behavior. If my plugin creates a Pin with additional documentation for something in the file, then it should be able to be picked up by the language server, right?
Thanks for reading!
The text was updated successfully, but these errors were encountered:
brettimus
changed the title
Help Developing Plugin: How can I show integration documentation of a pin added by a Convention?
Help Developing Plugin: How can I show integrated documentation of a Pin added by a Convention?
Feb 22, 2023
Hi! I am developing a plugin, and I'm not sure if I'm doing things the correct way.
Mainly, I just want to provide additional documentation for certain methods or symbols.
As a first step, I was trying to simply show a tooltip on hover. I created a pin for a token in the AST, and added a random doc string.
I couldn't seem to get anything to show up in the VS Code extension.
I verified that
Whenever solargraph looked for definitions given a cursor position, I noticed that the source_map pins that it looked for did not include the pin that my plugin added.
I was able to resolve this by having
SourceMap::Clip#define
also consider the pins of the source_map's environment:source_map.environ.pins
.More specifically, I changed the line that I linked to above to be the following:
I made this change since all the Pins added by Conventions are stored on the source_map's
environ
property, but not on the source_map'spins
attr. (See: here)To me, this seems like expected behavior. If my plugin creates a Pin with additional documentation for something in the file, then it should be able to be picked up by the language server, right?
Thanks for reading!
The text was updated successfully, but these errors were encountered: