Beispiel #1
0
 def outBuffer(self, buffer):
     console.editor.beginUndoAction()
     out = []
     mode = True
     for err, line in buffer:
         if err:
             console.writeError(line)
         else:
             console.write(line)
     console.editor.endUndoAction()
     console.editor.setReadOnly(0)
Beispiel #2
0
 def outBuffer(self, buffer):
     console.editor.beginUndoAction()
     out = []
     mode = True
     collect = []
     collectErr = None
     for err, line in buffer:
         collect.append(line)
         if collectErr is None:
             collectErr = err
         if collectErr != err:
             if collectErr: console.writeError(''.join(collect))
             else: console.write(''.join(collect))
             collectErr = err
             collect = []
     if collectErr: console.writeError(''.join(collect))
     else: console.write(''.join(collect))
     console.editor.endUndoAction()
     console.editor.setReadOnly(0)
Beispiel #3
0
import lspclient
from Npp import console
try:
    lspclient.format_document()
except Exception as e:
    console.writeError(f'error while formatting document: {e}')
Beispiel #4
0
 def stderr(self, s):
     console.editor.beginUndoAction()
     console.writeError(s)
     console.editor.endUndoAction()
     console.editor.setReadOnly(0)
import lspclient
from Npp import console
try:
    lspclient.clear_peek_definition()
except Exception as e:
    console.writeError(f'error while clearing peek annotation: {e}')
import lspclient
from Npp import console
try:
    lspclient.peek_definition()
except Exception as e:
    console.writeError(f'error while peeking: {e}')
Beispiel #7
0
import lspclient
from Npp import console
try:
    lspclient.goto_definition()
except Exception as e:
    console.writeError(f'error while going to definition position: {e}')
Beispiel #8
0
def list_all_markers():
    # used only for debugging purpose
    for i in range(editor.getLineCount()):
        _marker = editor.markerGet(i)
        if _marker > 0:
            console.writeError('{:>3} = {}\n'.format(i, _marker))
import lspclient
from Npp import console
try:
    lspclient.rename()
except Exception as e:
    console.writeError(f'error calling rename: {e}')
Beispiel #10
0
import lspclient
from Npp import notepad, console
try:
    lspclient.start(notepad.getPluginConfigDir()+'\\lsp_server_config.json')
except Exception as e:
    console.writeError(f'error starting lspclient: {e}')
    lspclient.stop()
Beispiel #11
0
import lspclient
from Npp import console
try:
    lspclient.references()
except Exception as e:
    console.writeError(f'error while trying to find references: {e}')