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

Fix LSP reporting wrong types #50913

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

Razoric480
Copy link
Contributor

@Razoric480 Razoric480 commented Jul 26, 2021

Classes were properties, functions interfaces, variables weren't distinguished from properties, functions from methods, etc.

Fixes #50815 and fixes #50822 . 4.0 companion to #50914 .

@akien-mga akien-mga merged commit 1777d80 into godotengine:master Jul 27, 2021
@akien-mga
Copy link
Member

Thanks!

@atirut-w
Copy link
Contributor

Thank you so much :D

@Razoric480 Razoric480 deleted the lsp-SymbolKind-fix branch September 25, 2021 21:43
@raulsntos
Copy link
Member

Why was the SymbolKind enum changed? It seems vscode defines it as 0-based, see https://github.com/microsoft/vscode/blob/459ffea03c117042c17c6a3c02f066c4af5db555/src/vs/editor/common/languages.ts#L1175-L1202.

@Razoric480
Copy link
Contributor Author

The LSP spec defines it as 1 based, and as I recall when I made this PR, there was a 1 off error.
https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol

@raulsntos
Copy link
Member

I see, but since the Godot vscode extension uses the enum defined by vscode which is 0 based, wouldn't that cause issues?

@Razoric480
Copy link
Contributor Author

In the VSCode LSP client protocol, there are functions like:

function asSymbolKind(item: ls.SymbolKind): code.SymbolKind {
		if (item <= ls.SymbolKind.TypeParameter) {
			// Symbol kind is one based in the protocol and zero based in code.
			return item - 1;
		}
		return code.SymbolKind.Property;
	}

to account for such discrepencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to C++ iterators broke LSP Godot's language server report functions as... interfaces????
5 participants