mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-25 04:04:27 +00:00
Tiny rearrangment and added some logging to begin with
This commit is contained in:
parent
9a3a6f54cc
commit
9660263dad
7 changed files with 132 additions and 38 deletions
|
@ -1,5 +1,6 @@
|
|||
import { connection, documents } from './server'
|
||||
import { readFileSync } from 'fs'
|
||||
import { conf } from './config'
|
||||
|
||||
export function postError(e: Error) {
|
||||
connection.window.showErrorMessage(e.message)
|
||||
|
@ -11,4 +12,8 @@ export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(
|
|||
export function getDocumentContents(uri: string): string {
|
||||
if (documents.keys().includes('file://' + uri)) return documents.get('file://' + uri).getText()
|
||||
else return readFileSync(uri).toString()
|
||||
}
|
||||
|
||||
export function trimPath(path: string): string {
|
||||
return path.replace(conf.shaderpacksPath, '')
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue