-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLVSCODE-152 Show Node-related settings on issue with Node path
- Loading branch information
1 parent
e213cca
commit c313fa7
Showing
13 changed files
with
158 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/test/java/org/sonarsource/sonarlint/ls/DefaultClientInputFileTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* SonarLint Language Server | ||
* Copyright (C) 2009-2020 SonarSource SA | ||
* mailto:info AT sonarsource DOT com | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarsource.sonarlint.ls; | ||
|
||
|
||
import java.util.stream.Stream; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
import org.sonarsource.sonarlint.core.client.api.common.Language; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class DefaultClientInputFileTest { | ||
|
||
@ParameterizedTest(name = "Should detect {0} as {1}") | ||
@MethodSource("provideParametersForLanguageDetection") | ||
void shouldDetectLanguage(String clientLanguageId, Language expected) { | ||
assertThat(new DefaultClientInputFile(null, null, "", false, clientLanguageId).language()) | ||
.isEqualTo(expected); | ||
} | ||
|
||
private static Stream<Arguments> provideParametersForLanguageDetection() { | ||
return Stream.of( | ||
Arguments.of("javascript", Language.JS), | ||
Arguments.of("javascriptreact", Language.JS), | ||
Arguments.of("vue", Language.JS), | ||
Arguments.of("vue component", Language.JS), | ||
Arguments.of("babel es6 javascript", Language.JS), | ||
|
||
Arguments.of("python", Language.PYTHON), | ||
|
||
Arguments.of("typescript", Language.TS), | ||
Arguments.of("typescriptreact", Language.TS), | ||
|
||
Arguments.of("html", Language.HTML), | ||
|
||
Arguments.of("oraclesql", Language.PLSQL), | ||
Arguments.of("plsql", Language.PLSQL), | ||
|
||
Arguments.of("apex", Language.APEX), | ||
Arguments.of("apex-anon", Language.APEX), | ||
|
||
Arguments.of("php", Language.PHP), | ||
Arguments.of("java", Language.JAVA), | ||
|
||
Arguments.of("unknown", null) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.