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

TokenType is 0 based according to LSP spec #964

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public class SemanticTokensTestUtil {

public static List<Integer> keywordSemanticTokens() {
List<List<Integer>> expectedTokens = new ArrayList<>();
expectedTokens.add(Arrays.asList(0,0,4,1,0));
expectedTokens.add(Arrays.asList(3,0,4,1,0));
expectedTokens.add(Arrays.asList(0,9,7,1,0));
expectedTokens.add(Arrays.asList(0,0,4,0,0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to increase as well the version number of the test plugin for the commit to be buildable.

expectedTokens.add(Arrays.asList(3,0,4,0,0));
expectedTokens.add(Arrays.asList(0,9,7,0,0));

return expectedTokens.stream().flatMap(List::stream).toList();
}
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Language Server Protocol client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e;singleton:=true
Bundle-Version: 0.18.7.qualifier
Bundle-Version: 0.18.8.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
org.eclipse.equinox.common;bundle-version="3.8.0",
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</parent>
<artifactId>org.eclipse.lsp4e</artifactId>
<packaging>eclipse-plugin</packaging>
<version>0.18.7-SNAPSHOT</version>
<version>0.18.8-SNAPSHOT</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 Avaloq Group AG.
* Copyright (c) 2022, 2024 Avaloq Group AG.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -106,7 +106,7 @@ public SemanticTokensDataStreamProcessor(@NonNull final Function<String, IToken>

private String tokenType(final Integer data, final List<String> legend) {
try {
return legend.get(data - 1);
return legend.get(data);
} catch (IndexOutOfBoundsException e) {
return null; // no match
}
Expand Down