Skip to content

Commit

Permalink
TokenType is 0 based according to LSP spec (#964)
Browse files Browse the repository at this point in the history
* TokenType is 0 based according to LSP spec
  • Loading branch information
BoykoAlex authored Apr 16, 2024
1 parent 7b0c49c commit d4e5765
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e.test/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: Tests for language server bundle (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.test;singleton:=true
Bundle-Version: 0.15.11.qualifier
Bundle-Version: 0.15.12.qualifier
Fragment-Host: org.eclipse.lsp4e
Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>
<artifactId>org.eclipse.lsp4e.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
<version>0.15.11-SNAPSHOT</version>
<version>0.15.12-SNAPSHOT</version>

<properties>
<os-jvm-flags /> <!-- for the default case -->
Expand Down
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));
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

0 comments on commit d4e5765

Please sign in to comment.