Skip to content

Commit

Permalink
Fix subtreeChanged() to call super and minor refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
halirutan committed May 2, 2018
1 parent 4ccb8d7 commit 50c135c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.40'
ext.kotlin_version = '1.2.41'

repositories {
mavenCentral()
Expand All @@ -12,7 +12,7 @@ buildscript {


plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.40"
id "org.jetbrains.kotlin.jvm" version "1.2.41"
id "org.jetbrains.intellij" version "0.3.1"
}

Expand Down Expand Up @@ -65,7 +65,7 @@ task wrapper(type: Wrapper) {
// Information about the plugin

// Plugin version number
version '3.0pre10'
version '3.0pre11'

intellij {
version = '2018.1.2'
Expand Down
1 change: 1 addition & 0 deletions resources/META-INF/change-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<i>New features and bug-fixes in version 3:</i>
<br/>
<ul>
<li>Fix for a bug in IDEA 2018</li>
<li>Project wide completion</li>
<li>Support for Mathematica source libraries</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ class CommentStarInsertEnterHandler : MathematicaEnterHandler() {
if (comment is PsiComment && offset >= commentRange.startOffset + 2 && offset <= commentRange.endOffset - 2) {

val document = editor.document
val textLength = document.textLength

val lineNumber = document.getLineNumber(offset)
val elementStartLine = document.getLineNumber(comment.textOffset)
val elementEndLine = document.getLineNumber(comment.textOffset + comment.textLength)
val lineStartOffset = document.getLineStartOffset(lineNumber)

val insertString: String
val move: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.psi.PsiFile;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.indexing.DataIndexer;
import com.intellij.util.indexing.FileBasedIndex.InputFilter;
import com.intellij.util.indexing.FileContent;
Expand All @@ -36,9 +34,7 @@
import de.halirutan.mathematica.lang.MathematicaLanguage;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.*;

/**
* Simple file index for functions that are exported from a package by giving them a usage message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ public String toString() {

@Override
public void subtreeChanged() {
// final PsiElement[] children = getChildren();
// for (PsiElement child : children) {
// if (child instanceof ExpressionImpl) {
// ((ExpressionImpl) child).subtreeChanged();
// }
// }

super.subtreeChanged();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public HashSet<SymbolResolveResult> getCachedDefinitions() {

@Override
public void subtreeChanged() {
super.subtreeChanged();
isCacheOutdated = true;
}
}
1 change: 1 addition & 0 deletions src/de/halirutan/mathematica/lang/psi/impl/SymbolImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public ResolveResult[] multiResolve(boolean incompleteCode) {

@Override
public void subtreeChanged() {
super.subtreeChanged();
myScope = null;
}

Expand Down

0 comments on commit 50c135c

Please sign in to comment.