mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-25 04:04:27 +00:00
Linting of all currently discovered files that contain the edited include at some depth is pretty much working! Issue #11 highlights the blocking bug
This commit is contained in:
parent
5e6a12c88b
commit
5a06d8ff1b
3 changed files with 58 additions and 30 deletions
|
@ -1,8 +1,14 @@
|
|||
import { connection } from './server'
|
||||
import { connection, documents } from './server'
|
||||
import { readFileSync } from 'fs'
|
||||
|
||||
export function postError(e: Error) {
|
||||
connection.window.showErrorMessage(e.message)
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(/^(?:\/)c%3A/, 'C:').replace(/\\/g, '/')
|
||||
export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(/^(?:\/)c%3A/, 'C:').replace(/\\/g, '/')
|
||||
|
||||
export function getDocumentContents(uri: string): string {
|
||||
if (documents.keys().includes('file://' + uri)) return documents.get('file://' + uri).getText()
|
||||
else return readFileSync(uri).toString()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue