-
Notifications
You must be signed in to change notification settings - Fork 15
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
Space before Definitions #20
Comments
I can reproduce the problem. Looking at the content of the document symbols (which are returned by the LSP itself), the start character for the range, which lsp-lens uses to figure out where to place the extmark lines, is actually 5. Notice in the image below that the range start value for the So, this appears to be a problem with Gopls, or lsp-lens has to figure out its own way to determine the indent for each extmark line it places. |
Hey @mcauley-penney, thanks for looking into this issue and providing the details. I'm on board with supporting this feature in the lsp-lens itself since it might be useful for other languages too. |
Sorry for replay late. I think it can be solved with |
Is it testable by something like this? |
Yes, this func returns how many indents the given line have. Namely the starting point of the given line. Official docs: |
I tried it, but still, I'm not sure what should I do in my LSP config. Would you please elaborate a little? |
Sorry for the ambiguity, this func is to get the indent of the given line which is the starting point of the line, I mean maybe we can use this func to get the indent and always display lens info at that point rather than the point provided by LSP, this will eliminate all leading spaces but I am not sure if this will broke with some language. 🤔 |
No problem at all! ;) ....
require'lsp-lens'.setup({
...
advanced = {
indent = "by_lsp",
},
}) Also, one unrelated question, how did you enable the third section ( |
Hi,
In Go, it shows space before interfaces definitions:
![image](https://private-user-images.githubusercontent.com/1261448/238939552-984b2bc9-c6ed-4626-9a47-b6b29f758dff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MDAzODEsIm5iZiI6MTcxOTcwMDA4MSwicGF0aCI6Ii8xMjYxNDQ4LzIzODkzOTU1Mi05ODRiMmJjOS1jNmVkLTQ2MjYtOWE0Ny1iNmIyOWY3NThkZmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMjIyODAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGU1NWYxN2EyNjYzY2QwMWZkNmVkOTNjOWY1ODNiY2IwM2RmMjI5ODQ4YmJhZmEyYWM5OTk2ZmMyOTY3NWM2NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Qy2PC1ZJ7vup5QjtkVwJsJ0rhmfA7cUDWN2Ma0JQElE)
As the screenshot shows, functions and methods display correctly, but only the interface has spaces.
Cheers,
Mort
The text was updated successfully, but these errors were encountered: