├── settings.gradle
├── src
├── test
│ ├── resources
│ │ └── data
│ │ │ ├── Widget.html
│ │ │ ├── App.html
│ │ │ ├── Sample1.svelte
│ │ │ ├── sample01.html
│ │ │ └── Sample1.txt
│ └── java
│ │ └── technology
│ │ └── svelte
│ │ └── lexer
│ │ ├── LexerToken.java
│ │ ├── SvelteParsingTest.java
│ │ ├── AbstractLexerTest.java
│ │ ├── SvelteLexerTest.java
│ │ └── SvelteTopLexerTest.java
└── main
│ ├── resources
│ ├── icons
│ │ └── svelte.png
│ └── META-INF
│ │ └── plugin.xml
│ ├── java
│ └── technology
│ │ └── svelte
│ │ ├── lexer
│ │ ├── LexerState.java
│ │ ├── SvelteElementType.java
│ │ ├── SvelteSubLexer.java
│ │ ├── SvelteLexer.java
│ │ ├── SvelteTopLexer.java
│ │ ├── LayeredLexer.java
│ │ └── SvelteTokenTypes.java
│ │ ├── Svelte.java
│ │ ├── SvelteIcons.java
│ │ ├── psi
│ │ ├── SvelteFile.java
│ │ └── impl
│ │ │ ├── SveltePsiElement.java
│ │ │ ├── MacroAttrImpl.java
│ │ │ ├── SvelteFileImpl.java
│ │ │ └── MacroNodeImpl.java
│ │ ├── file
│ │ ├── SvelteFileViewProviderFactory.java
│ │ ├── SvelteFileTypeFactory.java
│ │ ├── SvelteFileType.java
│ │ └── SvelteFileViewProvider.java
│ │ ├── completion
│ │ ├── SvelteCompletionContributor.java
│ │ └── KeywordCompletionProvider.java
│ │ ├── SvelteLanguage.java
│ │ ├── suppressions
│ │ └── XmlUnboundNsPrefixSuppressionProvider.java
│ │ ├── codeInsight
│ │ └── attributes
│ │ │ ├── SvelteAttributeDescriptorsProvider.java
│ │ │ └── SvelteAttributeDescriptor.java
│ │ ├── editor
│ │ ├── SvelteTemplateHighlighter.java
│ │ ├── SvelteSyntaxHighlighter.java
│ │ └── SvelteColorsPage.java
│ │ └── parser
│ │ ├── SvelteParser.java
│ │ └── SvelteParserDefinition.java
│ └── jflex
│ ├── technology
│ └── svelte
│ │ └── lexer
│ │ └── svelte.flex
│ └── idea-flex.skeleton
├── gradle
└── wrapper
│ └── gradle-wrapper.properties
├── .gitignore
├── sveltejs-idea-plugin.iml
├── README.adoc
├── LICENSE
├── gradlew.bat
└── gradlew
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'sveltejs-idea-plugin'
2 |
3 |
--------------------------------------------------------------------------------
/src/test/resources/data/Widget.html:
--------------------------------------------------------------------------------
1 |
And this is a nested component with {{foo}} where bar is {{bar}} and dynamic is {{dynamic}}
--------------------------------------------------------------------------------
/src/main/resources/icons/svelte.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dschulten/sveltejs-idea-plugin/HEAD/src/main/resources/icons/svelte.png
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/LexerState.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | /**
4 | * State of the lexer, to be pushed onto stack
5 | */
6 | public class LexerState {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/Svelte.java:
--------------------------------------------------------------------------------
1 | package technology.svelte;
2 |
3 |
4 | public class Svelte {
5 | public static final String languageName = "Svelte";
6 | public static final String languageDescription = "Svelte html components";
7 | }
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 10 19:16:06 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.ear
17 | *.zip
18 | *.tar.gz
19 | *.rar
20 |
21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22 | hs_err_pid*
23 |
24 | .idea/
25 | .gradle
26 | /out
27 | /gradle.properties
28 | /build
29 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/SvelteIcons.java:
--------------------------------------------------------------------------------
1 | package technology.svelte;
2 |
3 | import com.intellij.openapi.util.IconLoader;
4 | import javax.swing.*;
5 |
6 | /**
7 | * Created by IntelliJ IDEA.
8 | * User: juzna
9 | * Date: 1/11/12
10 | * Time: 3:13 AM
11 | * To change this template use File | Settings | File Templates.
12 | */
13 |
14 | public class SvelteIcons {
15 | public static Icon FILETYPE_ICON = IconLoader.getIcon("/icons/svelte.png", SvelteIcons.class);
16 | }
--------------------------------------------------------------------------------
/src/test/java/technology/svelte/lexer/LexerToken.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.psi.tree.IElementType;
4 |
5 | public class LexerToken {
6 | IElementType type;
7 | int start, end;
8 | String content;
9 |
10 | public LexerToken(IElementType type, int start, int end, String content) {
11 | this.type = type;
12 | this.start = start;
13 | this.end = end;
14 | this.content = content;
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/psi/SvelteFile.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.psi;
2 |
3 | import com.intellij.openapi.fileTypes.FileType;
4 | import com.intellij.psi.impl.PsiFileEx;
5 | import org.jetbrains.annotations.NotNull;
6 |
7 | /**
8 | * Created by IntelliJ IDEA.
9 | * User: juzna
10 | * Date: 1/26/12
11 | * Time: 1:35 AM
12 | * To change this template use File | Settings | File Templates.
13 | */
14 | public interface SvelteFile extends PsiFileEx {
15 | @NotNull
16 | @Override
17 | FileType getFileType();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/SvelteElementType.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.psi.tree.IElementType;
4 | import technology.svelte.SvelteLanguage;
5 | import org.jetbrains.annotations.NotNull;
6 |
7 |
8 | public class SvelteElementType extends IElementType {
9 | public SvelteElementType(@NotNull String debugName) {
10 | super(debugName, SvelteLanguage.SVELTE_LANGUAGE);
11 | }
12 |
13 | public String toString() {
14 | return "[Svelte] " + super.toString();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/psi/impl/SveltePsiElement.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.psi.impl;
2 |
3 | import com.intellij.extapi.psi.ASTDelegatePsiElement;
4 | import com.intellij.extapi.psi.ASTWrapperPsiElement;
5 | import com.intellij.lang.ASTNode;
6 | import com.intellij.psi.PsiElement;
7 | import com.intellij.psi.impl.source.tree.SharedImplUtil;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | /**
11 | * Base of all PsiElements
12 | */
13 | public class SveltePsiElement extends ASTWrapperPsiElement {
14 | public SveltePsiElement(@NotNull ASTNode astNode) {
15 | super(astNode);
16 | }
17 |
18 | // some common logic should come here
19 | }
20 |
--------------------------------------------------------------------------------
/sveltejs-idea-plugin.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/file/SvelteFileViewProviderFactory.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.file;
2 |
3 | import com.intellij.lang.Language;
4 | import com.intellij.openapi.vfs.VirtualFile;
5 | import com.intellij.psi.FileViewProvider;
6 | import com.intellij.psi.FileViewProviderFactory;
7 | import com.intellij.psi.PsiManager;
8 |
9 |
10 | public class SvelteFileViewProviderFactory implements FileViewProviderFactory {
11 | @Override
12 | public FileViewProvider createFileViewProvider(VirtualFile virtualFile, Language language, PsiManager psiManager, boolean physical) {
13 | return new SvelteFileViewProvider(psiManager, virtualFile, physical);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/SvelteSubLexer.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.lexer.FlexAdapter;
4 | import com.intellij.lexer.Lexer;
5 | import com.intellij.lexer.MergingLexerAdapter;
6 | import com.intellij.psi.tree.TokenSet;
7 |
8 | import java.io.Reader;
9 |
10 |
11 | public class SvelteSubLexer extends MergingLexerAdapter {
12 | // To be merged
13 | private static final TokenSet TOKENS_TO_MERGE = TokenSet.create(
14 | SvelteTokenTypes.WHITE_SPACE
15 | );
16 |
17 | public SvelteSubLexer() {
18 | super(null, TOKENS_TO_MERGE);
19 | // super(new FlexAdapter(new _SvelteSubLexer((Reader) null)), TOKENS_TO_MERGE);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/SvelteLexer.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 |
4 | import com.intellij.lexer.FlexAdapter;
5 | import com.intellij.lexer.MergingLexerAdapter;
6 | import com.intellij.psi.tree.IElementType;
7 | import com.intellij.psi.tree.TokenSet;
8 |
9 | import java.io.Reader;
10 |
11 |
12 | public class SvelteLexer extends MergingLexerAdapter {
13 | // To be merged
14 | private static final TokenSet TOKENS_TO_MERGE = TokenSet.create(
15 | SvelteTokenTypes.WHITE_SPACE,
16 | SvelteTokenTypes.TEMPLATE_HTML_TEXT
17 | );
18 |
19 | public SvelteLexer() {
20 | super(new FlexAdapter(new technology.svelte.lexer._SvelteLexer((Reader) null)), TOKENS_TO_MERGE);
21 | }
22 | }
--------------------------------------------------------------------------------
/src/test/resources/data/App.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/psi/impl/MacroAttrImpl.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.psi.impl;
2 |
3 | import com.intellij.lang.ASTNode;
4 | import com.intellij.psi.PsiElement;
5 | import technology.svelte.lexer.SvelteTokenTypes;
6 |
7 | /**
8 | * Curly brackets macro
9 | */
10 | public class MacroAttrImpl extends SveltePsiElement {
11 |
12 | public MacroAttrImpl(ASTNode node) {
13 | super(node);
14 | }
15 |
16 | public String getMacroName() {
17 | for(PsiElement el: getChildren()) {
18 | if(el.getNode().getElementType() == SvelteTokenTypes.BLOCK_STMT_NAME) return el.getText();
19 | }
20 | return null;
21 | }
22 |
23 | public PsiElement getParams() {
24 | for(PsiElement el: getChildren()) {
25 | if(el.getNode().getElementType() == SvelteTokenTypes.SVELTE_PARAMS) return el;
26 | }
27 | return null;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/README.adoc:
--------------------------------------------------------------------------------
1 | # sveltejs-idea-plugin
2 | Idea plugin for sveltejs components
3 |
4 | ## Usage
5 | Install in Idea via Settings -> Plugins -> Browse repositories -> (search for) Svelte
6 |
7 | Or download it from here and install it manually: https://plugins.jetbrains.com/plugin/10021-svelte
8 |
9 | ## For Plugin Developers
10 | The plugin requires Intellij Ultimate for development, since it depends on the Javascript plugin.
11 |
12 | ### Run the Plugin
13 | To start the plugin from Intellij, execute the runIde task from the list of intellij gradle tasks. It downloads a 2016.2 runtime and executes that version of intellij with the svelte plugin included.
14 |
15 | ### Build Distribution
16 | Run the buildPlugin task. The distribution will be created in build/distributions. Upload to https://plugins.jetbrains.com/plugin/edit?pluginId=10021[Plugin Repository].
17 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/completion/SvelteCompletionContributor.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.completion;
2 |
3 | import com.intellij.codeInsight.completion.CompletionContributor;
4 | import com.intellij.codeInsight.completion.CompletionType;
5 | import com.intellij.openapi.diagnostic.Logger;
6 | import com.intellij.patterns.StandardPatterns;
7 | import com.intellij.psi.PsiElement;
8 |
9 | /**
10 | * @author Dietrich Schulten - ds@escalon.de
11 | */
12 | public class SvelteCompletionContributor extends CompletionContributor {
13 | private static final Logger log = Logger.getInstance("SvelteCompletionContributor");
14 |
15 |
16 | public SvelteCompletionContributor() {
17 | log.info("Created Svelte completion contributor");
18 |
19 | extend(CompletionType.BASIC, StandardPatterns.instanceOf(PsiElement.class), new KeywordCompletionProvider());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/java/technology/svelte/lexer/SvelteParsingTest.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.lang.LanguageASTFactory;
4 | import com.intellij.openapi.application.PluginPathManager;
5 | import com.intellij.psi.PsiFile;
6 | import com.intellij.testFramework.ParsingTestCase;
7 | import com.intellij.testFramework.PlatformTestCase;
8 | import technology.svelte.parser.SvelteParserDefinition;
9 |
10 | public class SvelteParsingTest extends ParsingTestCase {
11 | public SvelteParsingTest() {
12 | super("", "svelte", new SvelteParserDefinition());
13 | }
14 |
15 | @Override
16 | protected void setUp() throws Exception {
17 | super.setUp();
18 | }
19 |
20 | @Override
21 | protected String getTestDataPath() {
22 | return "src/test/resources/data";
23 | }
24 |
25 | public void testSample1() throws Exception { doTest(true); }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/psi/impl/SvelteFileImpl.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.psi.impl;
2 |
3 | import com.intellij.extapi.psi.PsiFileBase;
4 | import com.intellij.openapi.fileTypes.FileType;
5 | import com.intellij.psi.FileViewProvider;
6 | import technology.svelte.SvelteLanguage;
7 | import technology.svelte.file.SvelteFileType;
8 | import technology.svelte.psi.SvelteFile;
9 | import org.jetbrains.annotations.NotNull;
10 |
11 | public class SvelteFileImpl extends PsiFileBase implements SvelteFile {
12 | public SvelteFileImpl(FileViewProvider viewProvider) {
13 | super(viewProvider, SvelteLanguage.SVELTE_LANGUAGE);
14 | }
15 |
16 | @NotNull
17 | @Override
18 | public FileType getFileType() {
19 | return SvelteFileType.SVELTE_FILE_TYPE;
20 | }
21 |
22 | @Override
23 | public String toString() {
24 | return "SvelteFile:" + getName();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/SvelteLanguage.java:
--------------------------------------------------------------------------------
1 | package technology.svelte;
2 |
3 |
4 | import com.intellij.lang.Language;
5 | import com.intellij.openapi.editor.colors.EditorColorsScheme;
6 | import com.intellij.openapi.editor.highlighter.EditorHighlighter;
7 | import com.intellij.openapi.fileTypes.*;
8 | import com.intellij.openapi.project.Project;
9 | import com.intellij.openapi.vfs.VirtualFile;
10 | import com.intellij.psi.templateLanguages.TemplateLanguage;
11 | import technology.svelte.editor.SvelteSyntaxHighlighter;
12 | import technology.svelte.editor.SvelteTemplateHighlighter;
13 | import org.jetbrains.annotations.NotNull;
14 | import org.jetbrains.annotations.Nullable;
15 |
16 |
17 | public class SvelteLanguage extends Language implements TemplateLanguage {
18 | // singleton
19 | public static final SvelteLanguage SVELTE_LANGUAGE = new SvelteLanguage();
20 |
21 | public SvelteLanguage() {
22 | super("Svelte", "application/x-svelte-template");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/psi/impl/MacroNodeImpl.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.psi.impl;
2 |
3 | import com.intellij.extapi.psi.ASTDelegatePsiElement;
4 | import com.intellij.lang.ASTNode;
5 | import com.intellij.psi.PsiElement;
6 | import com.intellij.psi.util.PsiTreeUtil;
7 | import technology.svelte.lexer.SvelteTokenTypes;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | /**
11 | * Curly brackets macro
12 | */
13 | public class MacroNodeImpl extends SveltePsiElement {
14 |
15 | public MacroNodeImpl(ASTNode node) {
16 | super(node);
17 | }
18 |
19 | public String getMacroName() {
20 | for(PsiElement el: getChildren()) {
21 | if(el.getNode().getElementType() == SvelteTokenTypes.BLOCK_STMT_NAME) return el.getText();
22 | }
23 | return null;
24 | }
25 |
26 | public PsiElement getParams() {
27 | for(PsiElement el: getChildren()) {
28 | if(el.getNode().getElementType() == SvelteTokenTypes.SVELTE_PARAMS) return el;
29 | }
30 | return null;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Dietrich Schulten
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/test/resources/data/Sample1.svelte:
--------------------------------------------------------------------------------
1 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/suppressions/XmlUnboundNsPrefixSuppressionProvider.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.suppressions;
2 |
3 | import com.intellij.codeInspection.DefaultXmlSuppressionProvider;
4 | import com.intellij.lang.Language;
5 | import com.intellij.psi.PsiElement;
6 | import com.intellij.psi.PsiFile;
7 | import org.jetbrains.annotations.NotNull;
8 |
9 | public class XmlUnboundNsPrefixSuppressionProvider extends DefaultXmlSuppressionProvider {
10 |
11 | @Override
12 | public boolean isProviderAvailable(@NotNull PsiFile file) {
13 | boolean ret;
14 | Language language = file.getLanguage();
15 | String languageID = language.getID();
16 | if ("HTML".equals(languageID)) {
17 | ret = true;
18 | } else {
19 | ret = false;
20 | }
21 | return ret;
22 | }
23 |
24 | @Override
25 | public boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String inspectionId) {
26 | boolean ret;
27 | if ("XmlUnboundNsPrefix".equals(inspectionId)) {
28 | ret = true;
29 | } else {
30 | ret = super.isSuppressedFor(element, inspectionId);
31 | }
32 | return ret;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/resources/data/sample01.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Application Skeleton
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | Sample page with only HTML code
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/test/java/technology/svelte/lexer/AbstractLexerTest.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.ide.plugins.PluginManager;
4 | import com.intellij.lexer.Lexer;
5 | import com.intellij.openapi.application.PluginPathManager;
6 | import com.intellij.openapi.application.ex.PathManagerEx;
7 | import com.intellij.psi.tree.IElementType;
8 | import com.intellij.testFramework.PlatformLiteFixture;
9 |
10 | import java.util.ArrayList;
11 |
12 |
13 | public abstract class AbstractLexerTest extends PlatformLiteFixture {
14 | Lexer lexer;
15 |
16 | protected String getTestDataPath() {
17 | return "src/test/resources/data";
18 | }
19 |
20 | protected void assertToken(LexerToken token, IElementType type, String content) {
21 | if(type != null) assertEquals(type, token.type);
22 | if(content != null) assertEquals(content, token.content);
23 | }
24 |
25 | protected LexerToken[] lex(String str) {
26 | ArrayList tokens = new ArrayList();
27 | IElementType el;
28 |
29 | lexer.start(str);
30 |
31 | while((el = lexer.getTokenType()) != null) {
32 | tokens.add(new LexerToken(el, lexer.getTokenStart(), lexer.getTokenEnd(), lexer.getTokenText()));
33 | lexer.advance();
34 | }
35 |
36 | return tokens.toArray(new LexerToken[tokens.size()]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/technology/svelte/lexer/SvelteLexerTest.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 |
4 | public class SvelteLexerTest extends AbstractLexerTest {
5 | @Override
6 | public void setUp() throws Exception {
7 | super.setUp();
8 | lexer = new SvelteLexer();
9 | }
10 |
11 | public void testIfElseEndif() throws Exception {
12 | LexerToken[] tokens = lex("Now you {{#if visible}}see me{{else}}don't{{/if}}");
13 |
14 | assertToken(tokens[0], SvelteTokenTypes.TEMPLATE_HTML_TEXT, "Now you ");
15 | assertToken(tokens[1], SvelteTokenTypes.OPENING, "{{");
16 | assertToken(tokens[2], SvelteTokenTypes.OPEN_BLOCK, "#");
17 | assertToken(tokens[3], SvelteTokenTypes.BLOCK_STMT_NAME, "if");
18 | assertToken(tokens[4], SvelteTokenTypes.SVELTE_PARAMS, " visible");
19 | assertToken(tokens[5], SvelteTokenTypes.CLOSING, "}}");
20 | assertToken(tokens[6], SvelteTokenTypes.TEMPLATE_HTML_TEXT, "see me");
21 | assertToken(tokens[7], SvelteTokenTypes.OPENING, "{{");
22 | assertToken(tokens[8], SvelteTokenTypes.BLOCK_STMT_NAME, "else");
23 | assertToken(tokens[9], SvelteTokenTypes.CLOSING, "}}");
24 | assertToken(tokens[10], SvelteTokenTypes.TEMPLATE_HTML_TEXT, "don't");
25 | assertToken(tokens[11], SvelteTokenTypes.OPENING, "{{");
26 | assertToken(tokens[12], SvelteTokenTypes.CLOSE_BLOCK, "/");
27 | assertToken(tokens[13], SvelteTokenTypes.BLOCK_STMT_NAME, "if");
28 | assertToken(tokens[14], SvelteTokenTypes.CLOSING, "}}");
29 | assertEquals(15, tokens.length);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/SvelteTopLexer.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 |
4 | import com.intellij.lexer.FlexAdapter;
5 | import com.intellij.lexer.Lexer;
6 | import com.intellij.lexer.LookAheadLexer;
7 | import com.intellij.lexer.MergingLexerAdapter;
8 | import com.intellij.psi.tree.IElementType;
9 | import com.intellij.psi.tree.TokenSet;
10 | import java.io.Reader;
11 |
12 |
13 | public class SvelteTopLexer extends MergingLexerAdapter {
14 | // To be merged
15 | private static final TokenSet TOKENS_TO_MERGE = TokenSet.create(
16 | SvelteTokenTypes.WHITE_SPACE,
17 | SvelteTokenTypes.TEMPLATE_HTML_TEXT
18 | );
19 |
20 | public SvelteTopLexer() {
21 | super(null, TOKENS_TO_MERGE);
22 | // super(new LookAheadLexer(new FlexAdapter(new _SvelteTopLexer((Reader) null))) {
23 | //
24 | // @Override
25 | // protected void lookAhead(Lexer lex) {
26 | // IElementType type = lex.getTokenType();
27 | // if(type == SvelteTokenTypes.N_ATTR) { // n: attr - keep all interesting tokens as they are
28 | // addToken(type);
29 | // lex.advance();
30 | //
31 | // while (SvelteTokenTypes.nAttrSet.contains(type = lex.getTokenType())) {
32 | // addToken(type);
33 | // lex.advance();
34 | // }
35 | // }
36 | //
37 | // if(SvelteTokenTypes.nAttrSet.contains(type)) addToken(SvelteTokenTypes.TEMPLATE_HTML_TEXT); // otherwise replace attributes by generic HTML
38 | // else addToken(type);
39 | //
40 | // lex.advance();
41 | // }
42 | // }, TOKENS_TO_MERGE);
43 | }
44 | }
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/codeInsight/attributes/SvelteAttributeDescriptorsProvider.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.codeInsight.attributes;
2 |
3 | import com.intellij.psi.xml.XmlAttribute;
4 | import com.intellij.psi.xml.XmlTag;
5 | import com.intellij.xml.XmlAttributeDescriptor;
6 | import com.intellij.xml.XmlAttributeDescriptorsProvider;
7 | import org.jetbrains.annotations.Nullable;
8 |
9 | import java.util.Arrays;
10 | import java.util.LinkedHashMap;
11 | import java.util.List;
12 | import java.util.Map;
13 |
14 | public class SvelteAttributeDescriptorsProvider implements XmlAttributeDescriptorsProvider {
15 |
16 | private final List svelteDirectives = Arrays.asList("on:", "bind:", "ref:");
17 |
18 | @Override
19 | public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag context) {
20 | final Map result = new LinkedHashMap<>();
21 | XmlAttribute[] attributes = context.getAttributes();
22 | for (XmlAttribute attribute : attributes) {
23 | String attributeName = attribute.getName();
24 | if(attributeName
25 | .contains(":")) {
26 | result.put(attributeName, new SvelteAttributeDescriptor(context.getProject(), attributeName));
27 | }
28 | }
29 | return result.values()
30 | .toArray(new XmlAttributeDescriptor[result.size()]);
31 | }
32 |
33 | @Nullable
34 | @Override
35 | public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, XmlTag context) {
36 | XmlAttributeDescriptor ret;
37 | if (attributeName.contains(":")) {
38 | ret = new SvelteAttributeDescriptor(context.getProject(), attributeName);
39 | } else {
40 | ret = null;
41 | }
42 | return ret;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/LayeredLexer.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.lexer.Lexer;
4 | import com.intellij.lexer.LookAheadLexer;
5 | import com.intellij.psi.tree.IElementType;
6 | import com.intellij.psi.tree.TokenSet;
7 |
8 | /**
9 | * Uses base-lexer to get big chunks, and several of them (typesToLex) are then lexed into smaller tokens using sub-lexer.
10 | *
11 | * Useful in some templating languages, where you lex-out whole chunks of your language, which is then lexed by another lexer.
12 | *
13 | * @author Jan Dolecek
14 | */
15 | public class LayeredLexer extends LookAheadLexer {
16 | protected Lexer subLexer;
17 | protected TokenSet typesToLex;
18 |
19 | /**
20 | * @param baseLexer Lexer which creates big chunks
21 | * @param subLexer Lexer which is applied to chunks from previous lexer
22 | * @param typesToLex Only these chunks from base-lexer are processed
23 | */
24 | public LayeredLexer(Lexer baseLexer, Lexer subLexer, TokenSet typesToLex) {
25 | super(baseLexer);
26 | this.subLexer = subLexer;
27 | this.typesToLex = typesToLex;
28 | }
29 |
30 | @Override
31 | protected void lookAhead(Lexer baseLexer) {
32 | if(typesToLex.contains(baseLexer.getTokenType())) {
33 | // Parse all sub tokens
34 | IElementType subToken;
35 | subLexer.start(baseLexer.getBufferSequence(), baseLexer.getTokenStart(), baseLexer.getTokenEnd());
36 | while((subToken = subLexer.getTokenType()) != null) {
37 | addToken(subLexer.getTokenEnd(), subToken);
38 | subLexer.advance();
39 | }
40 |
41 | baseLexer.advance();
42 |
43 | } else {
44 | addToken(baseLexer.getTokenType());
45 | baseLexer.advance();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/editor/SvelteTemplateHighlighter.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.editor;
2 |
3 | import com.intellij.lang.Language;
4 | import com.intellij.openapi.editor.colors.EditorColorsScheme;
5 | import com.intellij.openapi.editor.ex.util.LayerDescriptor;
6 | import com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter;
7 | import com.intellij.openapi.fileTypes.FileType;
8 | import com.intellij.openapi.fileTypes.StdFileTypes;
9 | import com.intellij.openapi.fileTypes.SyntaxHighlighter;
10 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
11 | import com.intellij.openapi.project.Project;
12 | import com.intellij.openapi.vfs.VirtualFile;
13 | import com.intellij.psi.templateLanguages.TemplateDataLanguageMappings;
14 | import technology.svelte.lexer.SvelteTokenTypes;
15 | import org.jetbrains.annotations.NotNull;
16 | import org.jetbrains.annotations.Nullable;
17 |
18 | /**
19 | * Layered highlighter - uses SvelteSyntaxHighlighter as main one, and second for outer text (HTML)
20 | */
21 | public class SvelteTemplateHighlighter extends LayeredLexerEditorHighlighter {
22 | public SvelteTemplateHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
23 | // create main highlighter
24 | super(new SvelteSyntaxHighlighter(), colors);
25 |
26 | // highlighter for outer lang
27 | FileType type = null;
28 | if(project == null || virtualFile == null) {
29 | type = StdFileTypes.PLAIN_TEXT;
30 | } else {
31 | Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(virtualFile);
32 | if(language != null) type = language.getAssociatedFileType();
33 | if(type == null) type = StdFileTypes.HTML;
34 | }
35 |
36 | SyntaxHighlighter outerHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(type, project, virtualFile);
37 |
38 | registerLayer(SvelteTokenTypes.TEMPLATE_HTML_TEXT, new LayerDescriptor(outerHighlighter, ""));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/file/SvelteFileTypeFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 Joachim Ansorg, mail@ansorg-it.com
3 | * File: BashFileTypeLoader.java, Class: BashFileTypeLoader
4 | * Last modified: 2010-03-24
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package technology.svelte.file;
20 |
21 | import com.intellij.framework.FrameworkAvailabilityCondition;
22 | import com.intellij.ide.DataManager;
23 | import com.intellij.openapi.actionSystem.DataContext;
24 | import com.intellij.openapi.actionSystem.DataKeys;
25 | import com.intellij.openapi.fileTypes.FileTypeConsumer;
26 | import com.intellij.openapi.fileTypes.FileTypeFactory;
27 | import com.intellij.openapi.project.Project;
28 | import com.intellij.openapi.roots.ModuleRootManager;
29 | import com.intellij.util.Consumer;
30 | import org.jetbrains.annotations.NotNull;
31 |
32 |
33 | public class SvelteFileTypeFactory extends FileTypeFactory {
34 | public void createFileTypes(@NotNull FileTypeConsumer consumer) {
35 | consumer.consume(SvelteFileType.SVELTE_FILE_TYPE, SvelteFileType.DEFAULT_EXTENSION+";html");
36 | // DataManager.getInstance()
37 | // .getDataContextFromFocus()
38 | // .doWhenDone((Consumer) dataContext -> {
39 | // Project project = DataKeys.PROJECT.getData(dataContext);
40 | // consumer.consume(SvelteFileType.SVELTE_FILE_TYPE, "html");
41 | // })
42 | // .getResult();
43 | // Project project = (Project) dataContext.getData(DataConstants.PROJECT);
44 | //
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/editor/SvelteSyntaxHighlighter.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.editor;
2 |
3 |
4 | import com.intellij.lexer.Lexer;
5 | import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
6 | import com.intellij.openapi.editor.HighlighterColors;
7 | import com.intellij.openapi.editor.colors.TextAttributesKey;
8 | import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
9 | import com.intellij.psi.tree.IElementType;
10 | import com.intellij.psi.tree.TokenSet;
11 | import technology.svelte.lexer.SvelteLexer;
12 | import technology.svelte.lexer.SvelteTokenTypes;
13 | import org.jetbrains.annotations.NotNull;
14 |
15 | import java.util.HashMap;
16 | import java.util.Map;
17 |
18 |
19 | public class SvelteSyntaxHighlighter extends SyntaxHighlighterBase {
20 |
21 | public static final String BAD_CHARACTER_ID = "Bad character";
22 | public static final TextAttributesKey BAD_CHARACTER = TextAttributesKey.createTextAttributesKey(BAD_CHARACTER_ID, HighlighterColors.BAD_CHARACTER.getDefaultAttributes()
23 | .clone());
24 |
25 | public static final String TEMPLATE_ID = "Template";
26 | public static final TextAttributesKey TEMPLATE = TextAttributesKey.createTextAttributesKey(TEMPLATE_ID, DefaultLanguageHighlighterColors.TEMPLATE_LANGUAGE_COLOR);
27 |
28 |
29 | // Groups of IElementType's
30 | public static final TokenSet sBAD = TokenSet.create(SvelteTokenTypes.BAD_CHARACTER);
31 | public static final TokenSet sTEMPLATE = TokenSet.create(
32 | SvelteTokenTypes.OPENING,
33 | SvelteTokenTypes.CLOSING,
34 | SvelteTokenTypes.BLOCK_STMT_NAME,
35 | SvelteTokenTypes.OPEN_BLOCK,
36 | SvelteTokenTypes.CLOSE_BLOCK);
37 |
38 | // Static container
39 | private static final Map ATTRIBUTES = new HashMap();
40 |
41 |
42 | // Fill in the map
43 | static {
44 | fillMap(ATTRIBUTES, sBAD, BAD_CHARACTER);
45 | fillMap(ATTRIBUTES, sTEMPLATE, TEMPLATE);
46 | }
47 |
48 |
49 | @NotNull
50 | @Override
51 | public Lexer getHighlightingLexer() {
52 | return new SvelteLexer();
53 | }
54 |
55 | @NotNull
56 | @Override
57 | public TextAttributesKey[] getTokenHighlights(IElementType type) {
58 | TextAttributesKey[] x = pack(ATTRIBUTES.get(type));
59 | return x;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/codeInsight/attributes/SvelteAttributeDescriptor.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.codeInsight.attributes;
2 |
3 | import com.intellij.lang.javascript.psi.*;
4 | import com.intellij.openapi.project.Project;
5 | import com.intellij.psi.PsiElement;
6 | import com.intellij.psi.stubs.StubIndexKey;
7 | import com.intellij.util.ArrayUtil;
8 | import com.intellij.xml.impl.BasicXmlAttributeDescriptor;
9 | import com.intellij.xml.impl.XmlAttributeDescriptorEx;
10 | import org.jetbrains.annotations.NonNls;
11 | import org.jetbrains.annotations.NotNull;
12 | import org.jetbrains.annotations.Nullable;
13 |
14 | public class SvelteAttributeDescriptor extends BasicXmlAttributeDescriptor implements XmlAttributeDescriptorEx {
15 |
16 | private final Project project;
17 | private final String attributeName;
18 | private final StubIndexKey index;
19 |
20 | public SvelteAttributeDescriptor(final Project project, String attributeName) {
21 | this.project = project;
22 | this.attributeName = attributeName;
23 | this.index = null;
24 | }
25 |
26 | @Nullable
27 | @Override
28 | public String handleTargetRename(@NotNull @NonNls String newTargetName) {
29 | return newTargetName;
30 | }
31 |
32 | @Override
33 | public boolean isRequired() {
34 | return false;
35 | }
36 |
37 | @Override
38 | public boolean hasIdType() {
39 | return false;
40 | }
41 |
42 | @Override
43 | public boolean hasIdRefType() {
44 | return false;
45 | }
46 |
47 | @Override
48 | public boolean isEnumerated() {
49 | return index != null;
50 | }
51 |
52 | @Override
53 | public PsiElement getDeclaration() {
54 | return null;
55 | }
56 |
57 | @Override
58 | public String getName() {
59 | return attributeName;
60 | }
61 |
62 | @Override
63 | public void init(PsiElement element) {
64 | }
65 |
66 | @Override
67 | public Object[] getDependences() {
68 | return ArrayUtil.EMPTY_OBJECT_ARRAY;
69 | }
70 |
71 | @Override
72 | public boolean isFixed() {
73 | return false;
74 | }
75 |
76 | @Override
77 | public String getDefaultValue() {
78 | return null;
79 | }
80 |
81 | @Override
82 | public String[] getEnumeratedValues() {
83 | return ArrayUtil.EMPTY_STRING_ARRAY;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/src/main/java/technology/svelte/lexer/SvelteTokenTypes.java:
--------------------------------------------------------------------------------
1 | package technology.svelte.lexer;
2 |
3 | import com.intellij.psi.TokenType;
4 | import com.intellij.psi.templateLanguages.TemplateDataElementType;
5 | import com.intellij.psi.tree.IElementType;
6 | import com.intellij.psi.tree.IFileElementType;
7 | import com.intellij.psi.tree.TokenSet;
8 | import technology.svelte.SvelteLanguage;
9 |
10 | /**
11 | * @author Dietrich Schulten - ds@escalon.de
12 | */
13 | public interface SvelteTokenTypes {
14 | // large grain parsing
15 | public static final IElementType TEMPLATE_HTML_TEXT =
16 | new SvelteElementType("SVELTE_TEMPLATE_HTML_TEXT"); // produced by lexer for all HTML code
17 |
18 |
19 | IElementType BAD_CHARACTER = TokenType.BAD_CHARACTER;
20 | IElementType WHITE_SPACE = TokenType.WHITE_SPACE;
21 |
22 | IElementType OPENING = new SvelteElementType("OPENING");
23 | IElementType CLOSING = new SvelteElementType("CLOSING");
24 |
25 | IElementType OPEN_BLOCK = new SvelteElementType("OPEN-BLOCK");
26 | IElementType CLOSE_BLOCK = new SvelteElementType("CLOSE-BLOCK");
27 |
28 |
29 | IElementType SVELTE_PARAMS = new SvelteElementType("PARAMS");
30 | IElementType BLOCK_STMT_NAME = new SvelteElementType("BLOCK_STMT_NAME");
31 | IElementType MACRO = new SvelteElementType("MACRO");
32 |
33 | IFileElementType FILE = new IFileElementType("FILE", SvelteLanguage.SVELTE_LANGUAGE);
34 |
35 | public static final IElementType OUTER_ELEMENT_TYPE = new SvelteElementType("SVELTE_FRAGMENT");
36 | public static final TemplateDataElementType TEMPLATE_DATA =
37 | new TemplateDataElementType("SVELTE_TEMPLATE_DATA", SvelteLanguage.SVELTE_LANGUAGE, TEMPLATE_HTML_TEXT, OUTER_ELEMENT_TYPE);
38 | // IElementType PARAMS = new SvelteElementType("PARAMS");
39 |
40 | // IElementType TAG_START = new SvelteElementType("TAG-START");
41 | // IElementType TAG_CLOSING = new SvelteElementType("TAG-CLOSING");
42 | // IElementType END_TAG = new SvelteElementType("END_TAG");
43 | // IElementType TAG_NAME = new SvelteElementType("TAG-NAME");
44 | // IElementType OUTER_TEXT = new SvelteElementType("OUTER-TEST");
45 | // IElementType SVELTE_STRING = new SvelteElementType("SVELTE-STRING");
46 | //
47 | // IElementType N_ATTR = new SvelteElementType("N-ATTR");
48 | // IElementType ATTR = new SvelteElementType("ATTR");
49 | // IElementType ATTR_VALUE = new SvelteElementType("ATTR-VALUE");
50 |
51 |
52 |
53 |
54 | TokenSet WHITESPACES = TokenSet.create(WHITE_SPACE);
55 | TokenSet STRING_LITERALS = TokenSet.create();
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/resources/META-INF/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 | de.escalon.idea.plugin.svelte
3 | Svelte
4 | from.build.gradle
5 | Escalon Systementwicklung,
6 | Dietrich Schulten
7 |
8 |
9 | Svelte components.
11 | ]]>
12 |
13 |
14 |
16 |
17 | - 0.0.1
18 | - Svelte directives not considered elements with unbound namespace
19 |
- 0.0.2
20 | - Compatibility extended to 2017.1
21 |
- 0.0.3
22 | - Compatibility extended to 2017.2
23 |
- 0.0.4
24 | - Minimal parsing, syntax-highlighting and code completion for Svelte templates
25 |
26 |