コード例 #1
0
ファイル: de_varscoper.py プロジェクト: exil/de_coldfusion
    def __parseXmlResult(self, xmlResult):
        result = de_util.getResultObject()

        try:
            xmlDoc = minidom.parseString(xmlResult)

            functionNodes = xmlDoc.getElementsByTagName("function")

            for fNode in functionNodes:
                fName = fNode.getAttribute("name")
                fDetail = fNode.firstChild

                fVariable = fDetail.getElementsByTagName(
                    "type")[0].firstChild.nodeValue
                fLineNumber = fDetail.getElementsByTagName(
                    "line_number")[0].firstChild.nodeValue

                errorText = "Function [ %s ] :: Variable [ %s ] " % (fName,
                                                                     fVariable)
                errorCaption = "Varscoper :: %s " % (fLineNumber)

                result["errors"].append(
                    de_util.returnErrorArray(errorCaption, errorText))
                result["regions"].append(
                    self.baseLinter.getRegion(fLineNumber))

        except Exception as e:
            de_util.log("Error parsing xml results :: " + str(e))

        return result
コード例 #2
0
ファイル: de_varscoper.py プロジェクト: exil/de_coldfusion
	def __parseXmlResult(self, xmlResult):
		result = de_util.getResultObject()

		try:
			xmlDoc = minidom.parseString(xmlResult)

			functionNodes =xmlDoc.getElementsByTagName("function")

			for fNode in functionNodes:
				fName = fNode.getAttribute("name")
				fDetail = fNode.firstChild

				fVariable = fDetail.getElementsByTagName("type")[0].firstChild.nodeValue
				fLineNumber = fDetail.getElementsByTagName("line_number")[0].firstChild.nodeValue
				
				errorText = "Function [ %s ] :: Variable [ %s ] " % (fName, fVariable)
				errorCaption = "Varscoper :: %s " % (fLineNumber)

				result["errors"].append(de_util.returnErrorArray(errorCaption, errorText))
				result["regions"].append(self.baseLinter.getRegion(fLineNumber))

		except Exception as e:
			de_util.log("Error parsing xml results :: " + str(e))

		return result
コード例 #3
0
ファイル: de_standard.py プロジェクト: exil/de_coldfusion
	def __getErrors(self, regex=None, errorText=None, selections=None):
		if selections is None:
			selections = self.view.find_all(regex, sublime.IGNORECASE)

		errorResult = None

		if selections:
			errorResult = de_util.getResultObject()
			errorResult["regions"] = selections

			for region in selections:
				lineNumber = self.baseLinter.getLineNumber(region)
				errorCaption = "DE Standard :: %+5s " % (str(lineNumber))

				errorResult["errors"].append(de_util.returnErrorArray(errorCaption, errorText))

		return errorResult
コード例 #4
0
ファイル: de_standard.py プロジェクト: exil/de_coldfusion
    def __getErrors(self, regex=None, errorText=None, selections=None):
        if selections is None:
            selections = self.view.find_all(regex, sublime.IGNORECASE)

        errorResult = None

        if selections:
            errorResult = de_util.getResultObject()
            errorResult["regions"] = selections

            for region in selections:
                lineNumber = self.baseLinter.getLineNumber(region)
                errorCaption = "DE Standard :: %+5s " % (str(lineNumber))

                errorResult["errors"].append(
                    de_util.returnErrorArray(errorCaption, errorText))

        return errorResult