Skip to content

Commit 11efb3f

Browse files
committed
Use outputChannelLanguage proposed API
- Set outputChannelLanguage in enabledApiProposals - Use different vscode-objectscript specific mimetype so other output channels are not affected - Use proposed API to pass languageId - Add some cases for highlighting class/routine name in up-to-date message
1 parent 89a0c14 commit 11efb3f

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"enableProposedApi": true,
5353
"enabledApiProposals": [
5454
"fileSearchProvider",
55-
"textSearchProvider"
55+
"textSearchProvider",
56+
"outputChannelLanguage"
5657
],
5758
"activationEvents": [
5859
"onDebug",
@@ -451,7 +452,7 @@
451452
"id": "vscode-objectscript-output",
452453
"aliases": [],
453454
"mimetypes": [
454-
"text/x-code-output"
455+
"text/x-vscode-objectscript-output"
455456
]
456457
}
457458
],

src/utils/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ import { R_OK } from "constants";
44
import * as url from "url";
55
import { exec } from "child_process";
66
import * as vscode from "vscode";
7-
import { config, schemas, workspaceState, terminals } from "../extension";
7+
import { config, schemas, workspaceState, terminals, extensionId } from "../extension";
88
import { getCategory } from "../commands/export";
9+
const packageJson = vscode.extensions.getExtension(extensionId).packageJSON;
910

1011
let latestErrorMessage = "";
1112
export const outputChannel: {
1213
resetError?(): void;
1314
appendError?(value: string, show?: boolean): void;
14-
} & vscode.OutputChannel = vscode.window.createOutputChannel("ObjectScript");
15+
} & vscode.OutputChannel =
16+
typeof packageJson.enabledApiProposals === "object" &&
17+
packageJson.enabledApiProposals.includes("outputChannelLanguage")
18+
? vscode.window.createOutputChannel("ObjectScript", "vscode-objectscript-output")
19+
: vscode.window.createOutputChannel("ObjectScript");
1520

1621
/// Append Error if no duplicates previous one
1722
outputChannel.appendError = (value: string, show = true): void => {

syntaxes/vscode-objectscript-output.tmLanguage.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
"match": "(?<=^Dropping orphaned procedure\\: )\\S+",
3636
"name": "entity.name.class"
3737
},
38+
{
39+
"match": "(?<=^(?:Class|Routine|File|Table) )\\S+(?= is up-to-date\\.)",
40+
"name": "entity.name.class"
41+
},
42+
{
43+
"match": "\\S+(?= is up to date\\. Compile of this item skipped\\.)",
44+
"name": "entity.name.class"
45+
},
3846
{
3947
"match": "(?<=^\\s*ERROR\\:\\s*)\\S+",
4048
"name": "entity.name.class"

0 commit comments

Comments
 (0)