Skip to content

Commit fb55b45

Browse files
authored
Merge pull request #276 from SeeSharpSoft/master
Hotfix Release 2.16.2
2 parents 54087d5 + 6b793fc commit fb55b45

File tree

6 files changed

+96
-2
lines changed

6 files changed

+96
-2
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
schedule:
18+
- cron: '18 7 * * 6'
19+
20+
jobs:
21+
analyze:
22+
name: Analyze
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
language: [ 'java' ]
29+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
30+
# Learn more:
31+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v2
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v1
40+
with:
41+
languages: ${{ matrix.language }}
42+
# If you wish to specify custom queries, you can do so here or in a config file.
43+
# By default, queries listed here will override any specified in a config file.
44+
# Prefix the list here with "+" to use these queries and those in the config file.
45+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
46+
47+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48+
# If this step fails, then you should remove it and run the build manually (see below)
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v1
51+
52+
# ℹ️ Command-line programs to run using the OS shell.
53+
# 📚 https://git.io/JvXDl
54+
55+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
56+
# and modify them (or add more) to build your code if your project
57+
# uses a compiled language
58+
59+
#- run: |
60+
# make bootstrap
61+
# make release
62+
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v1

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.16.2
2+
Apr 21, 2021
3+
4+
FIX: Editor complaining about crashes on PyCharm 2021.1 #274
5+
16
2.16.1
27
Apr 20, 2021
38

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jacocoTestReport {
2828
}
2929

3030
group 'net.seesharpsoft.intellij.plugins'
31-
version '2.16.1'
31+
version '2.16.2'
3232

3333
apply plugin: 'java'
3434
project.sourceCompatibility = JavaVersion.VERSION_11

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvHelper.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.intellij.lang.*;
44
import com.intellij.lexer.Lexer;
5+
import com.intellij.openapi.fileTypes.FileType;
6+
import com.intellij.openapi.fileTypes.FileTypeRegistry;
57
import com.intellij.openapi.project.Project;
68
import com.intellij.openapi.vfs.VirtualFile;
79
import com.intellij.psi.PsiElement;
@@ -20,6 +22,8 @@
2022
import net.seesharpsoft.intellij.plugins.csv.psi.CsvRecord;
2123
import net.seesharpsoft.intellij.plugins.csv.psi.CsvTypes;
2224
import net.seesharpsoft.intellij.plugins.csv.settings.CsvEditorSettings;
25+
import net.seesharpsoft.intellij.plugins.psv.PsvFileType;
26+
import net.seesharpsoft.intellij.plugins.tsv.TsvFileType;
2327
import org.jetbrains.annotations.NotNull;
2428

2529
import java.util.HashMap;
@@ -45,6 +49,26 @@ public static PsiElement createEmptyCsvField(PsiFile psiFile) {
4549
return node.getPsi();
4650
}
4751

52+
public static boolean isCsvFile(String extension) {
53+
if (extension == null) {
54+
return false;
55+
}
56+
// simple check to always in include the defaults even if association was removed
57+
switch(extension.toLowerCase()) {
58+
case "csv":
59+
case "tsv":
60+
case "tab":
61+
case "psv":
62+
return true;
63+
default:
64+
// but also consider other extensions that are associated manually
65+
FileType fileType = FileTypeRegistry.getInstance().getFileTypeByExtension(extension);
66+
return fileType == CsvFileType.INSTANCE ||
67+
fileType == TsvFileType.INSTANCE ||
68+
fileType == PsvFileType.INSTANCE;
69+
}
70+
}
71+
4872
public static boolean isCsvFile(Project project, VirtualFile file) {
4973
if (project == null || file == null) {
5074
return false;

src/main/java/net/seesharpsoft/intellij/plugins/csv/components/CsvFileAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void cleanupAttributeMap(@NotNull Project project) {
6363
if (virtualFile == null) {
6464
LOG.debug(fileName + " not found");
6565
faultyFiles.add(fileName);
66-
} else if (!CsvHelper.isCsvFile(project, virtualFile)) {
66+
} else if (!CsvHelper.isCsvFile(virtualFile.getExtension())) {
6767
LOG.debug(fileName + " is not a csv file");
6868
faultyFiles.add(fileName);
6969
}

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ NEW: "General" settings group
5555
FIX: Lower annotator severity to not appear as problem
5656
FIX: Prevent non CSV entries in CSV attributes map #268
5757
FIX: keep existing & correct entries in CSV attributes map
58+
HOTFIX: Editor complaining about crashes on PyCharm 2021.1 #274
5859
</pre>
5960
]]>
6061
</change-notes>

0 commit comments

Comments
 (0)