mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-08-31 13:57:27 +00:00
Some basic completion provider. Need to go through all the options and tweak them
This commit is contained in:
parent
63151eaa76
commit
a65a6c1bb3
9 changed files with 399 additions and 41 deletions
18
shaders.py
Normal file
18
shaders.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
with open('shaders.txt') as f:
|
||||
items = {}
|
||||
lines = filter(lambda s: s.startswith('uniform'), f.readlines())
|
||||
for line in lines:
|
||||
err = False
|
||||
try:
|
||||
detail = int(' '.join(line.split()[3:]))
|
||||
err = True
|
||||
except:
|
||||
pass
|
||||
type = line.split()[1].rstrip('>').lstrip('<')
|
||||
detail = ' '.join(line.split()[3:]) if not err else ''
|
||||
label = line.split()[2].rstrip(';')
|
||||
if label in items:
|
||||
continue
|
||||
items[label] = True
|
||||
detail = ' ' + detail if not detail == '' else ''
|
||||
print('{\n\tlabel: \'%s\',\n\tdetail: \'<%s>%s\'\n},' % (label, type, detail))
|
Loading…
Add table
Add a link
Reference in a new issue