# 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

syntaxChecked(str, dict)
  emited when the syntax check was done.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

SyntaxCheckService | Constructor
__determineLanguage | Private methode to determine the language of the file.
addLanguage | Public method to register a new language to the supported languages.
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.
syntaxCheck | Public method to prepare to compile one Python source file to Python bytecode and to perform a pyflakes check.

### 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.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.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.syntaxCheck

syntaxCheck(lang, filename, source)

Public method to prepare to compile one Python source file to Python bytecode and to perform a pyflakes check.

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