summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2024-02-05 12:55:33 -0500
committerbscan <10503608+bscan@users.noreply.github.com>2024-02-05 12:55:33 -0500
commitaf06faea0961d4cb447fc5920f5a662175b972b4 (patch)
tree29d965f89e9cd4a950717e268ec85360f5c28c01
parentf95e8f181c760d8d4c17f977b92839173153efbe (diff)
downloadPerlNavigator-af06faea0961d4cb447fc5920f5a662175b972b4.zip
Allow disabling perl -c via settings. Also bumping version
-rw-r--r--package-lock.json4
-rw-r--r--package.json8
-rw-r--r--perlnavigator-0.8.1.vsix (renamed from perlnavigator-0.8.0.vsix)bin1039700 -> 1039989 bytes
-rw-r--r--server/package-lock.json4
-rw-r--r--server/package.json2
-rw-r--r--server/src/diagnostics.ts8
-rw-r--r--server/src/server.ts1
-rw-r--r--server/src/types.ts1
8 files changed, 21 insertions, 7 deletions
diff --git a/package-lock.json b/package-lock.json
index dbb074e..f33a9a6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "perlnavigator",
- "version": "0.8.0",
+ "version": "0.8.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "perlnavigator",
- "version": "0.8.0",
+ "version": "0.8.1",
"hasInstallScript": true,
"license": "MIT",
"bin": {
diff --git a/package.json b/package.json
index b4a9920..18fa79b 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "Code navigation, autocompletion, syntax checking, and linting for Perl",
"author": "bscan",
"license": "MIT",
- "version": "0.8.0",
+ "version": "0.8.1",
"icon": "images/camel_icon.png",
"repository": {
"type": "git",
@@ -108,6 +108,12 @@
"type": "string",
"description": "Regex pattern with policies to include for perl critic (normally in profile)"
},
+ "perlnavigator.perlCompileEnabled": {
+ "scope": "resource",
+ "type": "boolean",
+ "default": true,
+ "description": "Enable running perl -c on your code"
+ },
"perlnavigator.severity5": {
"scope": "resource",
"type": "string",
diff --git a/perlnavigator-0.8.0.vsix b/perlnavigator-0.8.1.vsix
index 3bf613a..db63f84 100644
--- a/perlnavigator-0.8.0.vsix
+++ b/perlnavigator-0.8.1.vsix
Binary files differ
diff --git a/server/package-lock.json b/server/package-lock.json
index 721e875..2705642 100644
--- a/server/package-lock.json
+++ b/server/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "perlnavigator-server",
- "version": "0.8.0",
+ "version": "0.8.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "perlnavigator-server",
- "version": "0.8.0",
+ "version": "0.8.1",
"license": "MIT",
"dependencies": {
"lru-cache": "^6.0.0",
diff --git a/server/package.json b/server/package.json
index 312bed3..f5b39e3 100644
--- a/server/package.json
+++ b/server/package.json
@@ -1,7 +1,7 @@
{
"name": "perlnavigator-server",
"description": "Perl language server",
- "version": "0.8.0",
+ "version": "0.8.1",
"author": "bscan",
"license": "MIT",
"engines": {
diff --git a/server/src/diagnostics.ts b/server/src/diagnostics.ts
index b74902c..64eec17 100644
--- a/server/src/diagnostics.ts
+++ b/server/src/diagnostics.ts
@@ -11,6 +11,13 @@ import { parseDocument } from "./parser";
import { TextDocument } from "vscode-languageserver-textdocument";
export async function perlcompile(textDocument: TextDocument, workspaceFolders: WorkspaceFolder[] | null, settings: NavigatorSettings): Promise<CompilationResults | void> {
+
+ const parsingPromise = parseDocument(textDocument, ParseType.selfNavigation);
+
+ if (!settings.perlCompileEnabled){
+ const parsedDoc = await parsingPromise;
+ return { diags: [], perlDoc: parsedDoc };
+ }
let perlParams: string[] = [...settings.perlParams, "-c"];
const filePath = Uri.parse(textDocument.uri).fsPath;
@@ -19,7 +26,6 @@ export async function perlcompile(textDocument: TextDocument, workspaceFolders:
perlParams = perlParams.concat(getInquisitor());
nLog("Starting perl compilation check with the equivalent of: " + settings.perlPath + " " + perlParams.join(" ") + " " + filePath, settings);
- const parsingPromise = parseDocument(textDocument, ParseType.selfNavigation);
let output: string;
let stdout: string;
diff --git a/server/src/server.ts b/server/src/server.ts
index 943516e..2c33819 100644
--- a/server/src/server.ts
+++ b/server/src/server.ts
@@ -114,6 +114,7 @@ const defaultSettings: NavigatorSettings = {
perlimportsLintEnabled: false,
perlimportsTidyEnabled: false,
perltidyEnabled: true,
+ perlCompileEnabled: true,
severity5: "warning",
severity4: "info",
severity3: "hint",
diff --git a/server/src/types.ts b/server/src/types.ts
index 3aae855..bf4394f 100644
--- a/server/src/types.ts
+++ b/server/src/types.ts
@@ -19,6 +19,7 @@ export interface NavigatorSettings {
perlimportsProfile: string;
perltidyEnabled: boolean;
perltidyProfile: string;
+ perlCompileEnabled: boolean;
severity5: string;
severity4: string;
severity3: string;