Support document parse on runtime package
This commit is contained in:
parent
9d8ffba8be
commit
3cf5e4cf40
3 changed files with 11 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
|||
"type": "git",
|
||||
"url": "git://github.com/DanielGavin/ols.git"
|
||||
},
|
||||
"version": "0.1.36",
|
||||
"version": "0.1.37",
|
||||
"engines": {
|
||||
"vscode": "^1.96.0"
|
||||
},
|
||||
|
|
|
@ -29,7 +29,7 @@ const onDidChange: vscode.EventEmitter<void> = new vscode.EventEmitter<void>();
|
|||
|
||||
const JSON5 = require('json5')
|
||||
|
||||
const defaultConfig = JSON5.stringify(
|
||||
const defaultConfig = JSON.stringify(
|
||||
{
|
||||
$schema: "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/ols.schema.json",
|
||||
enable_document_symbols: true,
|
||||
|
|
|
@ -312,6 +312,11 @@ document_refresh :: proc(document: ^Document, config: ^common.Config, writer: ^W
|
|||
return .ParseError
|
||||
}
|
||||
|
||||
if strings.contains(document.uri.uri, "base/builtin/builtin.odin") ||
|
||||
strings.contains(document.uri.uri, "base/intrinsics/intrinsics.odin") {
|
||||
return .None
|
||||
}
|
||||
|
||||
if writer != nil && len(errors) > 0 && !config.disable_parser_errors {
|
||||
document.diagnosed_errors = true
|
||||
|
||||
|
@ -397,6 +402,10 @@ parse_document :: proc(document: ^Document, config: ^common.Config) -> ([]Parser
|
|||
pkg.kind = .Normal
|
||||
pkg.fullpath = document.fullpath
|
||||
|
||||
if strings.contains(document.fullpath, "base/runtime") {
|
||||
pkg.kind = .Runtime
|
||||
}
|
||||
|
||||
document.ast = ast.File {
|
||||
fullpath = document.fullpath,
|
||||
src = string(document.text[:document.used_text]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue