コード例 #1
0
    def run(self):
        view = self.window.active_view()
        filename = view.file_name()
        
        view = self.window.active_view()
        region1 = view.sel()[0]
        position = region1.a

        # get method usage 
        # and put it to clipboard
        funcUsage = modelCopyMethoUsageGo.main_getFuncUsageByFileNameAndPosition(filename, position)
        sublime.set_clipboard(funcUsage)
        sublime.status_message("set to clipboard: "+funcUsage)
	def test_testName(self):
		color.blue("test here baby")
		filename=os.path.join(currentFolder, 'poligon/forTest.go')
		position = 1283
		result = modelCopyMethoUsageGo.main_getFuncUsageByFileNameAndPosition(filename, position)
		expected = """/*var (
	

	firstDigits string
	en bool
	ds *calldb.DataStore

	locals *MegaLocals
        )*/
locals = numbersMegaLocals(firstDigits,en,ds)"""
		assertMy.equals(result, expected)