Home ⌂Doc Index ◂Up ▴

eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService

Module implementing an interface to add different languages to do a syntax check.

Global Attributes

None

Classes

SyntaxCheckService Implement the syntax check service.

Functions

None


SyntaxCheckService

Implement the syntax check service.

Plugins can add other languages to the syntax check by calling addLanguage and support of an extra checker module on the client side which has to connect directly to the background service.

Signals

batchFinished()
emitted when a syntax check batch is done
error(str, str)
emitted in case of an error
syntaxChecked(str, dict)
emitted when the syntax check was done for one file

Derived from

QObject

Class Attributes

None

Class Methods

None

Methods

SyntaxCheckService Constructor
__determineLanguage Private methode to determine the language of the file.
__serviceError Private slot handling service errors.
addLanguage Public method to register a new language to the supported languages.
batchJobDone Public slot handling the completion of a batch job.
cancelSyntaxBatchCheck Public method to cancel all batch jobs.
getExtensions Public method to return all supported file extensions for the syntax checker dialog.
getLanguages Public method to return the supported language names.
removeLanguage Public method to remove the language from syntax check.
serviceErrorJSON Public method handling service errors for JSON.
serviceErrorJavaScript Public method handling service errors for JavaScript.
serviceErrorPy3 Public method handling service errors for Python 3.
serviceErrorYAML Public method handling service errors for YAML.
syntaxBatchCheck Public method to prepare a syntax check on multiple source files.
syntaxCheck Public method to prepare a syntax check of one source file.

Static Methods

None

SyntaxCheckService (Constructor)

SyntaxCheckService()

Constructor

SyntaxCheckService.__determineLanguage

__determineLanguage(filename, source)

Private methode to determine the language of the file.

filename
of the sourcefile (str)
source
code of the file (str)
Returns:
language of the file or None if not found (str or None)

SyntaxCheckService.__serviceError

__serviceError(fn, msg)

Private slot handling service errors.

fn
file name (string)
msg
message text (string)

SyntaxCheckService.addLanguage

addLanguage(lang, env, path, module, getArgs, getExt, callback, onError)

Public method to register a new language to the supported languages.

lang
new language to check syntax (str)
env
the environment in which the checker is implemented (str)
path
full path to the module (str)
module
name to import (str)
getArgs
function to collect the required arguments to call the syntax checker on client side (function)
getExt
function that returns the supported file extensions of the syntax checker (function)
callback
function on service response (function)
onError
callback function if client or service isn't available (function)

SyntaxCheckService.batchJobDone

batchJobDone(fx, lang)

Public slot handling the completion of a batch job.

fx
service name (string)
lang
language (string)

SyntaxCheckService.cancelSyntaxBatchCheck

cancelSyntaxBatchCheck()

Public method to cancel all batch jobs.

SyntaxCheckService.getExtensions

getExtensions()

Public method to return all supported file extensions for the syntax checker dialog.

Returns:
set of all supported file extensions (set of str)

SyntaxCheckService.getLanguages

getLanguages()

Public method to return the supported language names.

Returns:
list of languanges supported (list of str)

SyntaxCheckService.removeLanguage

removeLanguage(lang)

Public method to remove the language from syntax check.

lang
language to remove (str)

SyntaxCheckService.serviceErrorJSON

serviceErrorJSON(fx, lang, fn, msg)

Public method handling service errors for JSON.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

SyntaxCheckService.serviceErrorJavaScript

serviceErrorJavaScript(fx, lang, fn, msg)

Public method handling service errors for JavaScript.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

SyntaxCheckService.serviceErrorPy3

serviceErrorPy3(fx, lang, fn, msg)

Public method handling service errors for Python 3.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

SyntaxCheckService.serviceErrorYAML

serviceErrorYAML(fx, lang, fn, msg)

Public method handling service errors for YAML.

fx
service name (string)
lang
language (string)
fn
file name (string)
msg
message text (string)

SyntaxCheckService.syntaxBatchCheck

syntaxBatchCheck(argumentsList)

Public method to prepare a syntax check on multiple source files.

argumentsList
list of arguments tuples with each tuple containing filename and source (string, string)

SyntaxCheckService.syntaxCheck

syntaxCheck(lang, filename, source)

Public method to prepare a syntax check of one source file.

lang
language of the file or None to determine by internal algorithm (str or None)
filename
source filename (string)
source
string containing the code to check (string)
Up



Home ⌂Doc Index ◂Up ▴