Skip to content

Commit ce02dcb

Browse files
committed
LuaLanguageConfiguration
1 parent 65f933c commit ce02dcb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/extension.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from
1010
import { AttachDebuggerProvider } from './debugger/AttachDebuggerProvider';
1111
import { MobDebuggerProvider } from './debugger/MobDebuggerProvider';
1212
import { formatText } from 'lua-fmt';
13+
import { LuaLanguageConfiguration } from './languageConfiguration';
1314

1415
const LANGUAGE_ID = 'lua'; //EmmyLua
1516
const DEBUG_MODE = false;
@@ -39,6 +40,7 @@ export function activate(context: vscode.ExtensionContext) {
3940
}
4041
}
4142
);
43+
vscode.languages.setLanguageConfiguration("lua", new LuaLanguageConfiguration());
4244

4345
const attProvider = new AttachDebuggerProvider();
4446
savedContext.subscriptions.push(vscode.debug.registerDebugConfigurationProvider("emmylua_attach", attProvider));

src/languageConfiguration.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { LanguageConfiguration, IndentAction } from "vscode";
2+
3+
export class LuaLanguageConfiguration implements LanguageConfiguration {
4+
public onEnterRules = [
5+
{
6+
action: { indentAction: IndentAction.None, appendText: "---" },
7+
beforeText: /^---/,
8+
}
9+
];
10+
}

0 commit comments

Comments
 (0)