Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix-idea
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca3dd6ca459f
Choose a base ref
...
head repository: NixOS/nix-idea
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d332de05c326
Choose a head ref
  • 10 commits
  • 9 files changed
  • 2 contributors

Commits on Dec 21, 2020

  1. Update Gradle plugins

    JojOatXGME committed Dec 21, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    rickie Rick Ossendrijver
    Copy the full SHA
    b2d3fa5 View commit details
  2. Copy the full SHA
    ee182ad View commit details
  3. Copy the full SHA
    93bbabf View commit details
  4. Copy the full SHA
    22bf94c View commit details
  5. Copy the full SHA
    4296405 View commit details
  6. Copy the full SHA
    bdb3daf View commit details
  7. Copy the full SHA
    f1dc261 View commit details
  8. Copy the full SHA
    dc56820 View commit details
  9. Copy the full SHA
    3f32ecb View commit details

Commits on Jan 5, 2021

  1. Copy the full SHA
    d332de0 View commit details
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased]
### Added
- Support for IDEA 2020.3
### Removed
- Support for IDEA 2019.3
## [0.3.0.3]
### Fixed
- Change ID of plugin back from `org.nixos.idea` in version 0.3.0.0 to
`nix-idea` from earlier versions. The different ID of version 0.3.0.0
15 changes: 12 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ plugins {
// Java support
id("java")
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "0.4.21"
id("org.jetbrains.intellij") version "0.6.5"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "0.4.0"
id("org.jetbrains.changelog") version "0.6.2"
// grammarkit - read more: https://github.com/JetBrains/gradle-grammar-kit-plugin
id("org.jetbrains.grammarkit") version "2020.1"
id("org.jetbrains.grammarkit") version "2020.3.2"
}

// Import variables from gradle.properties file
@@ -20,6 +20,7 @@ val pluginName: String by project
val pluginVersion: String by project
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project
val pluginVerifierIdeVersions: String by project

val platformType: String by project
val platformVersion: String by project
@@ -43,6 +44,10 @@ intellij {
updateSinceUntilBuild = true
}

changelog {
headerParserRegex = "^[-._+0-9a-zA-Z]+\$"
}

grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
jflexRelease = "1.7.0-1"
@@ -127,6 +132,10 @@ tasks {
)
}

runPluginVerifier {
ideVersions(pluginVerifierIdeVersions)
}

publishPlugin {
token(System.getenv("JETBRAINS_TOKEN"))
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
9 changes: 6 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -3,9 +3,12 @@

pluginGroup = org.nixos.idea
pluginName = NixIDEA
pluginVersion = 0.3.0.3
pluginSinceBuild = 193
pluginUntilBuild = 202.*
pluginVersion = 0.3.0.4
pluginSinceBuild = 201
pluginUntilBuild = 203.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions = 2020.1.4, 2020.2.3, 2020.3.1

platformType = IC
platformVersion = 2020.1
8 changes: 0 additions & 8 deletions src/main/java/org/nixos/idea/file/NixFileType.java
Original file line number Diff line number Diff line change
@@ -11,14 +11,6 @@
public class NixFileType extends LanguageFileType {

public static final NixFileType INSTANCE = new NixFileType();
public static final NixFileType SHELL = new NixFileType();
public static final NixFileType RELEASE = new NixFileType();
public static final NixFileType NIXOS_MODULE = new NixFileType();
public static final NixFileType SIMPLE_STDENV_PKG = new NixFileType();
public static final NixFileType NIXOPS_INFRA = new NixFileType();
public static final NixFileType DISNIX_SERVICE_MAPPING = new NixFileType();
public static final NixFileType DISNIX_INFRA = new NixFileType();
public static final NixFileType DISNIX_DEPLOY = new NixFileType();

private NixFileType() {
super(NixLanguage.INSTANCE);
12 changes: 0 additions & 12 deletions src/main/java/org/nixos/idea/file/NixFileTypeFactory.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/org/nixos/idea/icon/NixIcons.java
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@
import javax.swing.*;

public class NixIcons {
public static final Icon FILE = IconLoader.getIcon("/org/nixos/idea/icon/nixos-icon.png");
public static final Icon FILE = IconLoader.getIcon("/org/nixos/idea/icon/nixos-icon.png", NixIcons.class);
}
14 changes: 10 additions & 4 deletions src/main/java/org/nixos/idea/lang/NixParserDefinition.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.nixos.idea.lang;

import org.nixos.idea.file.NixFile;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.lang.ParserDefinition;
@@ -14,9 +13,9 @@
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.TokenSet;
import org.nixos.idea.lang.NixParser;
import org.nixos.idea.psi.NixTypes;
import org.jetbrains.annotations.NotNull;
import org.nixos.idea.file.NixFile;
import org.nixos.idea.psi.NixTypes;

import java.io.Reader;

@@ -35,21 +34,25 @@ public Lexer createLexer(Project project) {
}

@NotNull
@Override
public TokenSet getWhitespaceTokens() {
return WHITE_SPACES;
}

@NotNull
@Override
public TokenSet getCommentTokens() {
return COMMENTS;
}

@NotNull
@Override
public TokenSet getStringLiteralElements() {
return STRING_LITERALS;
}

@NotNull
@Override
public PsiParser createParser(final Project project) {
return new NixParser();
}
@@ -59,15 +62,18 @@ public IFileElementType getFileNodeType() {
return FILE;
}

@Override
public PsiFile createFile(FileViewProvider viewProvider) {
return new NixFile(viewProvider);
}

public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) {
@Override
public SpaceRequirements spaceExistenceTypeBetweenTokens(ASTNode left, ASTNode right) {
return SpaceRequirements.MAY;
}

@NotNull
@Override
public PsiElement createElement(ASTNode node) {
return NixTypes.Factory.createElement(node);
}
13 changes: 5 additions & 8 deletions src/main/java/org/nixos/idea/lang/NixSyntaxHighlighter.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package org.nixos.idea.lang;

import org.nixos.idea.psi.NixTypes;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;

import com.intellij.lexer.FlexAdapter;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import org.nixos.idea.psi.NixTypes;

import java.io.Reader;

import static com.intellij.openapi.editor.colors.TextAttributesKey.EMPTY_ARRAY;
import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;

public class NixSyntaxHighlighter extends SyntaxHighlighterBase {
@@ -187,7 +184,7 @@ public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
tokenType == NixTypes.REQUIRES) {
return KEYWORD_KEYS;
}
return EMPTY;
return EMPTY_ARRAY;
}
}
}
10 changes: 6 additions & 4 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -4,14 +4,16 @@
<name>NixIDEA</name>
<vendor>NixOS</vendor>

<idea-version since-build="202" />

<depends>com.intellij.modules.lang</depends>

<extensions defaultExtensionNs="com.intellij">

<fileTypeFactory
implementation="org.nixos.idea.file.NixFileTypeFactory" />
<fileType
name="Nix file"
implementationClass="org.nixos.idea.file.NixFileType"
fieldName="INSTANCE"
language="Nix"
extensions="nix" />

<lang.parserDefinition
language="Nix"