Skip to content

Commit ace9d89

Browse files
author
edsgerlin
committed
Unify configurations to simple-perl.
1 parent 4206bbb commit ace9d89

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

package.json

+7-9
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@
1616
],
1717
"main": "./out/extension",
1818
"contributes": {
19-
"snippets": [
20-
{
21-
"language": "perl",
22-
"path": "./snippets/perl.json"
23-
}
24-
],
19+
"snippets": [{
20+
"language": "perl",
21+
"path": "./snippets/perl.json"
22+
}],
2523
"configuration": {
2624
"type": "object",
2725
"title": "Simple Perl configuration",
2826
"properties": {
29-
"perl.perltidy": {
27+
"simple-perl.perltidy": {
3028
"type": "string",
3129
"default": "perltidy",
3230
"description": "The name or path to the perltidy executable that will be used when formatting code."
3331
},
34-
"perl.perltidyArgs": {
32+
"shimple-perl.perltidyArgs": {
3533
"type": "array",
3634
"default": [
3735
"-q"
@@ -55,4 +53,4 @@
5553
"@types/node": "~10.12.18",
5654
"@types/mocha": "~5.2.5"
5755
}
58-
}
56+
}

src/format.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class PerlFormattingProvider implements DocumentRangeFormattingEditProvid
1818
);
1919
}
2020

21-
const config = workspace.getConfiguration("perl");
21+
const config = workspace.getConfiguration("simple-perl");
2222
const executable = config.get("perltidy", "perltidy");
2323
const args = config.get("perltidyArgs", ["-q"]);
2424
const text = document.getText(range);
@@ -27,7 +27,7 @@ export class PerlFormattingProvider implements DocumentRangeFormattingEditProvid
2727
child.stdin.write(text);
2828
child.stdin.end();
2929

30-
const stdoutChunks: string[] = [];
30+
const stdoutChunks: string[] = [];
3131
child.stdout.on("data", (chunk: Buffer) => {
3232
stdoutChunks.push(chunk.toString());
3333
});
@@ -48,7 +48,7 @@ export class PerlFormattingProvider implements DocumentRangeFormattingEditProvid
4848
const errorMessage = stderr.concat(stdout).trim();
4949
reject(`Could not format, code: ${code}, error: ${errorMessage}`);
5050
} else {
51-
resolve([new TextEdit(range, stdout)]) ;
51+
resolve([new TextEdit(range, stdout)]);
5252
}
5353
});
5454
}).catch((reason) => {

src/linter.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class PerlLinterProvider {
1515

1616
public constructor(subscriptions: Disposable[]) {
1717
this.diagnosticCollection = languages.createDiagnosticCollection();
18-
this.configuration = workspace.getConfiguration("perl-toolbox.lint");
18+
this.configuration = workspace.getConfiguration("simple-perl.lint");
1919

2020
workspace.onDidCloseTextDocument(
2121
(textDocument) => {
@@ -46,9 +46,6 @@ export default class PerlLinterProvider {
4646
if (textDocument.languageId !== "perl") {
4747
return;
4848
}
49-
if (!this.configuration.enabled) {
50-
return;
51-
}
5249
const decodedChunks: Buffer[] = [];
5350
const tempfilepath =
5451
tmpdir() +

0 commit comments

Comments
 (0)