Skip to content

Instantly share code, notes, and snippets.

@yogeshlonkar
Last active March 22, 2021 12:14
Show Gist options
  • Save yogeshlonkar/201ab99b91b98f95ae6e868f031c9b1e to your computer and use it in GitHub Desktop.
Save yogeshlonkar/201ab99b91b98f95ae6e868f031c9b1e to your computer and use it in GitHub Desktop.
ycm_gopls_issue
[Trace - 17:42:11.817 PM] Sending request 'initialize - (1)'.
Params: {"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"documentationFormat":["plaintext","markdown"]},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"contentFormat":["plaintext","markdown"]},"signatureHelp":{"signatureInformation":{"documentationFormat":["plaintext","markdown"],"parameterInformation":{"labelOffsetSupport":true}}},"synchronization":{"didSave":true}},"workspace":{"applyEdit":true,"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"workspaceEdit":{"documentChanges":true}}},"initializationOptions":{"hoverKind":"Structured"},"processId":80076,"rootPath":"****/****","rootUri":"file://****/****"}
[Trace - 17:42:11.818 PM] Received response 'initialize - (1)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{\"path\":\"golang.org/x/tools/gopls\",\"version\":\"v0.6.9\",\"sum\":\"h1:LBBcE2y3Tb4bp79JVLWCQBbvYCFEs5ADGWsQDoSLk1Q=\",\"deps\":[{\"path\":\"github.com/BurntSushi/toml\",\"version\":\"v0.3.1\",\"sum\":\"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\"},{\"path\":\"github.com/google/go-cmp\",\"version\":\"v0.5.5\",\"sum\":\"h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=\"},{\"path\":\"github.com/sergi/go-diff\",\"version\":\"v1.1.0\",\"sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\"},{\"path\":\"golang.org/x/mod\",\"version\":\"v0.4.1\",\"sum\":\"h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=\"},{\"path\":\"golang.org/x/sync\",\"version\":\"v0.0.0-20201020160332-67f06af15bc9\",\"sum\":\"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=\"},{\"path\":\"golang.org/x/sys\",\"version\":\"v0.0.0-20210124154548-22da62e12c0c\",\"sum\":\"h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=\"},{\"path\":\"golang.org/x/tools\",\"version\":\"v0.1.1-0.20210319172145-bda8f5cee399\",\"sum\":\"h1:O5bm8buX/OaamnfcBrkjn0SPUIU30jFmaS8lP+ikkxs=\"},{\"path\":\"golang.org/x/xerrors\",\"version\":\"v0.0.0-20200804184101-5ec99f83aff1\",\"sum\":\"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\"},{\"path\":\"honnef.co/go/tools\",\"version\":\"v0.1.1\",\"sum\":\"h1:EVDuO03OCZwpV2t/tLLxPmPiomagMoBOgfPt0FM+4IY=\"},{\"path\":\"mvdan.cc/gofumpt\",\"version\":\"v0.1.0\",\"sum\":\"h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=\"},{\"path\":\"mvdan.cc/xurls/v2\",\"version\":\"v2.2.0\",\"sum\":\"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\"}]}"}}
[Trace - 17:42:11.819 PM] Sending notification 'initialized'.
Params: {}
[Trace - 17:42:11.819 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":{"hoverKind":"Structured"}}
[Trace - 17:42:11.819 PM] Received notification 'window/showMessage'.
Params: {"type":4,"message":"Loading packages..."}
[Trace - 17:42:11.819 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"languageId":"go","text":"package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/raphamorim/go-rainbow\"\n\tlog \"github.com/sirupsen/logrus\"\n\t\"github.com/urfave/cli/v2\"\n\tactions \"github.com/yogeshlonkar/go-github-actions\"\n\t\"gopkg.in/yaml.v2\"\n\n\t\"github.com/****/pkg/convert\"\n)\n\nvar (\n\tversion = \"0.0.0\" // populated at compile time\n\tcommit = \"HEAD\" // populated at compile time\n\temptyProps = regexp.MustCompile(`(?m): ({}|\"\")$`)\n\tcommentOnDefault = regexp.MustCompile(`(?m)^(\\s*)(default:)$`)\n\tcommentOnDetectBranch = regexp.MustCompile(`(?m)^(\\s*)(` + convert.DetectBranchOnTagJobID + `:)$`)\n\tcommentOnSecret = regexp.MustCompile(`(?m)^(\\s*)(.*: \\$\\{\\{\\ssecrets.[^G][^L][^O][^B][^A][^L][^_].*)$`)\n\tcommentOnDroneComplex = regexp.MustCompile(`(?m)^(\\s*)(.*: .*\\$\\{DRONE_([a-zA-Z0-9_]|([\\:\\#\\/\\-\\=\\?\\+\\%\\^]))*\\})`)\n)\n\nfunc main() {\n\tlog.SetOutput(os.Stderr)\n\tlog.SetFormatter(LogFormatter{})\n\tapp := &cli.App{\n\t\tName: \"drone-to-gha\",\n\t\tUsage: \"utility to help migrate drone pipelines to Github actions workflow\",\n\t\tVersion: version,\n\t\tFlags: []cli.Flag{\n\t\t\t&cli.BoolFlag{\n\t\t\t\tName: \"std-in-out\",\n\t\t\t\tAliases: []string{\"io\"},\n\t\t\t\tUsage: \"use stdin for drone file content and stdout for workflow content\",\n\t\t\t},\n\t\t\t&cli.PathFlag{\n\t\t\t\tName: \"drone-file\",\n\t\t\t\tAliases: []string{\"d\"},\n\t\t\t\tValue: \".drone.yml\",\n\t\t\t\tUsage: \"drone file to convert\",\n\t\t\t},\n\t\t\t&cli.PathFlag{\n\t\t\t\tName: \"output-file\",\n\t\t\t\tAliases: []string{\"o\"},\n\t\t\t\tValue: \"github-workflow.yml\",\n\t\t\t\tUsage: \"output file where converted pipeline will be written to\",\n\t\t\t},\n\t\t\t&cli.BoolFlag{\n\t\t\t\tName: \"debug\",\n\t\t\t\tUsage: \"enables debug level output\",\n\t\t\t\tHidden: true,\n\t\t\t},\n\t\t},\n\t\tAction: MainAction,\n\t}\n\n\terr := app.Run(os.Args)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc MainAction(c *cli.Context) error {\n\tif c.Bool(\"debug\") {\n\t\tlog.SetLevel(log.DebugLevel)\n\t\tlog.Debugf(\"Commit: %s\", commit)\n\t\tlog.Debugf(\"Version: %s\", version)\n\t}\n\tvar err error\n\tvar workflow *actions.Workflow\n\tisStdInOut := c.Bool(\"std-in-out\")\n\tif isStdInOut {\n\t\tcontent, err := ioutil.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tworkflow, err = convert.ToWorkFlowsFromString(string(content))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tdroneFile := c.String(\"drone-file\")\n\t\tworkflow, err = convert.ToWorkFlowsFromFile(droneFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tyaml.FutureLineWrap()\n\tout, err := yaml.Marshal(workflow)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkflowContent := sanitizeAndComment(string(out))\n\tif isStdInOut {\n\t\tfmt.Print(workflowContent)\n\t} else {\n\t\tworkflowFile := c.String(\"output-file\")\n\t\terr = ioutil.WriteFile(workflowFile, []byte(workflowContent), 0644)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Infof(\"Coverted pipeline written in %s\", workflowFile)\n\t}\n\tif len(workflow.Jobs) > 3 {\n\t\tlog.Infof(\"Total %d Jobs. You should split the jobs in multiple files\", len(workflow.Jobs))\n\t}\n\tlog.Warn(\"This tool is to provide base workflow/ jobs/ steps from drone pipeline that can be quickly reviewed/ modified to create workflows similar to drone pipeline. Please review each job and step carefully\")\n\treturn err\n}\n\nfunc sanitizeAndComment(workflowContent string) string {\n\tworkflowContent = emptyProps.ReplaceAllString(workflowContent, \":\")\n\tworkflowContent = strings.Replace(workflowContent, \"\\\"on\\\":\", \"on:\", 1)\n\tworkflowContent = commentOnDefault.ReplaceAllString(workflowContent, \"$1# This job contains steps which didn't had any when condition in drone\\n$1$2\")\n\tworkflowContent = commentOnDetectBranch.ReplaceAllString(workflowContent, \"$1# Github actions doesn't provide base branch on tag event, this job detects it\\n$1$2\")\n\tworkflowContent = commentOnSecret.ReplaceAllString(workflowContent, \"$1# You need to add this secret to github repo secret\\n$1$2\")\n\tworkflowContent = commentOnDroneComplex.ReplaceAllString(workflowContent, \"$1# Shell parameter expansion is not possible outside of a run step. You need to create an extra step to compute the value into a new variable\\n$1$2\")\n\treturn workflowContent\n}\n\ntype LogFormatter struct {\n}\n\nfunc (f LogFormatter) Format(entry *log.Entry) ([]byte, error) {\n\tmessage := \"\"\n\tswitch entry.Level {\n\tcase log.TraceLevel:\n\t\tmessage = rainbow.Blue(entry.Message)\n\tcase log.DebugLevel:\n\t\tmessage = rainbow.Black(rainbow.BgWhite(entry.Message))\n\tcase log.InfoLevel:\n\t\tmessage = rainbow.White(entry.Message)\n\tcase log.WarnLevel:\n\t\tmessage = \"\u2755 \" + rainbow.Yellow(entry.Message)\n\tcase log.ErrorLevel:\n\t\tmessage = \"\u2757\ufe0f \" + rainbow.Red(entry.Message)\n\tcase log.FatalLevel:\n\t\tmessage = \"\ud83d\udca5 \" + rainbow.Red(entry.Message)\n\t}\n\treturn []byte(fmt.Sprintln(message)), nil\n}\n","uri":"file://****/****/main.go","version":1}}
[Trace - 17:42:11.819 PM] Received request 'workspace/configuration - (1)'.
Params: {"items":[{"scopeUri":"file://****/****","section":"gopls"}]}
[Trace - 17:42:11.820 PM] Sending response 'workspace/configuration - (1)' in 0ms.
Result: [{"hoverKind":"Structured"}]
[Trace - 17:42:11.928 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/03/22 17:42:11 go env for ****/****\n(root ****/****)\n(go version go version go1.16.2 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGONOSUMDB=\nGOPROXY=https://proxy.golang.org,direct\nGOROOT=/usr/local/Cellar/go/1.16.2/libexec\nGOINSECURE=\nGOMOD=****/****/go.mod\nGOMODCACHE=****/go/pkg/mod\nGOFLAGS=\nGOPRIVATE=\nGOSUMDB=sum.golang.org\nGOPATH=****/go\nGONOPROXY=\nGO111MODULE=\nGOCACHE=****/Library/Caches/go-build\n\n"}
[Trace - 17:42:12.429 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/03/22 17:42:12 go/packages.Load\n\tsnapshot=0\n\tdirectory=****/****\n\tquery=[builtin github.com/****/...]\n\tpackages=14\n"}
[Trace - 17:42:12.617 PM] Received notification 'window/showMessage'.
Params: {"type":3,"message":"Finished loading packages."}
[Trace - 17:42:12.629 PM] Received request 'client/registerCapability - (2)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"{****/****/internal,****/****/internal/drone,****/****/internal/drone/backend,****/****/internal/drone/backend/docker,****/****/internal/drone/compiler,****/****/internal/drone/linter,****/****/internal/drone/matrix,****/****/internal/drone/types,****/****/internal/yaml,****/****/pkg,****/****/pkg/convert,****/****/pkg/steputil}","kind":7}]}}]}
2021-03-22 17:42:11,656 - DEBUG - No global extra conf, not calling method YcmCorePreload
****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/observers/__init__.py:73: UserWarning: Failed to import fsevents. Fall back to kqueue
warnings.warn("Failed to import fsevents. Fall back to kqueue")
2021-03-22 17:42:11,690 - INFO - Completion config: 50, detailing 10 candiates
2021-03-22 17:42:11,690 - INFO - Completion config: 50, detailing 10 candiates
2021-03-22 17:42:11,690 - INFO - Completion config: 50, detailing 10 candiates
2021-03-22 17:42:11,690 - INFO - Completion config: 50, detailing 10 candiates
2021-03-22 17:42:11,730 - INFO - Received ready request
2021-03-22 17:42:11,735 - INFO - Received signature help available request
2021-03-22 17:42:11,736 - INFO - Completion config: 50, detailing 10 candiates
2021-03-22 17:42:11,768 - INFO - Received event notification
2021-03-22 17:42:11,768 - DEBUG - Event name: BufferVisit
2021-03-22 17:42:11,769 - INFO - Received event notification
2021-03-22 17:42:11,770 - DEBUG - Event name: FileReadyToParse
2021-03-22 17:42:11,770 - INFO - Adding buffer identifiers for file: ****/****/main.go
2021-03-22 17:42:11,771 - INFO - Starting gopls: ['****/go/bin/gopls', '-rpc.trace', '-logfile', None, '-rpc.trace']
2021-03-22 17:42:11,775 - INFO - gopls started with PID 80079
2021-03-22 17:42:11,777 - DEBUG - TX: Sending message: b'Content-Length: 1125\r\n\r\n{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"documentationFormat":["plaintext","markdown"]},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"contentFormat":["plaintext","markdown"]},"signatureHelp":{"signatureInformation":{"documentationFormat":["plaintext","markdown"],"parameterInformation":{"labelOffsetSupport":true}}},"synchronization":{"didSave":true}},"workspace":{"applyEdit":true,"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"workspaceEdit":{"documentChanges":true}}},"initializationOptions":{"hoverKind":"Structured"},"processId":80076,"rootPath":"****/****","rootUri":"file://****/****"}}'
2021-03-22 17:42:11,818 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{\\"path\\":\\"golang.org/x/tools/gopls\\",\\"version\\":\\"v0.6.9\\",\\"sum\\":\\"h1:LBBcE2y3Tb4bp79JVLWCQBbvYCFEs5ADGWsQDoSLk1Q=\\",\\"deps\\":[{\\"path\\":\\"github.com/BurntSushi/toml\\",\\"version\\":\\"v0.3.1\\",\\"sum\\":\\"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\\"},{\\"path\\":\\"github.com/google/go-cmp\\",\\"version\\":\\"v0.5.5\\",\\"sum\\":\\"h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=\\"},{\\"path\\":\\"github.com/sergi/go-diff\\",\\"version\\":\\"v1.1.0\\",\\"sum\\":\\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\\"},{\\"path\\":\\"golang.org/x/mod\\",\\"version\\":\\"v0.4.1\\",\\"sum\\":\\"h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=\\"},{\\"path\\":\\"golang.org/x/sync\\",\\"version\\":\\"v0.0.0-20201020160332-67f06af15bc9\\",\\"sum\\":\\"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=\\"},{\\"path\\":\\"golang.org/x/sys\\",\\"version\\":\\"v0.0.0-20210124154548-22da62e12c0c\\",\\"sum\\":\\"h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=\\"},{\\"path\\":\\"golang.org/x/tools\\",\\"version\\":\\"v0.1.1-0.20210319172145-bda8f5cee399\\",\\"sum\\":\\"h1:O5bm8buX/OaamnfcBrkjn0SPUIU30jFmaS8lP+ikkxs=\\"},{\\"path\\":\\"golang.org/x/xerrors\\",\\"version\\":\\"v0.0.0-20200804184101-5ec99f83aff1\\",\\"sum\\":\\"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\\"},{\\"path\\":\\"honnef.co/go/tools\\",\\"version\\":\\"v0.1.1\\",\\"sum\\":\\"h1:EVDuO03OCZwpV2t/tLLxPmPiomagMoBOgfPt0FM+4IY=\\"},{\\"path\\":\\"mvdan.cc/gofumpt\\",\\"version\\":\\"v0.1.0\\",\\"sum\\":\\"h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=\\"},{\\"path\\":\\"mvdan.cc/xurls/v2\\",\\"version\\":\\"v2.2.0\\",\\"sum\\":\\"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\\"}]}"}},"id":1}'
2021-03-22 17:42:11,818 - INFO - None: Language server does not require resolve request
2021-03-22 17:42:11,819 - INFO - None: Language server requires sync type of Incremental
2021-03-22 17:42:11,819 - DEBUG - go: Server declares trigger characters: ['.']
2021-03-22 17:42:11,819 - INFO - go: Using trigger characters for semantic triggers: .
2021-03-22 17:42:11,819 - DEBUG - go: Server declares signature trigger characters: ['(', ',']
2021-03-22 17:42:11,819 - INFO - go: Using characters for signature triggers: (,,
2021-03-22 17:42:11,819 - DEBUG - TX: Sending notification: b'Content-Length: 52\r\n\r\n{"jsonrpc":"2.0","method":"initialized","params":{}}'
2021-03-22 17:42:11,819 - DEBUG - TX: Sending notification: b'Content-Length: 110\r\n\r\n{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"hoverKind":"Structured"}}}'
2021-03-22 17:42:11,819 - DEBUG - Refreshing file ****/****/main.go: State is Open/action Open
2021-03-22 17:42:11,819 - DEBUG - TX: Sending notification: b'Content-Length: 5373\r\n\r\n{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"go","text":"package main\\n\\nimport (\\n\\t\\"fmt\\"\\n\\t\\"io/ioutil\\"\\n\\t\\"os\\"\\n\\t\\"regexp\\"\\n\\t\\"strings\\"\\n\\n\\t\\"github.com/raphamorim/go-rainbow\\"\\n\\tlog \\"github.com/sirupsen/logrus\\"\\n\\t\\"github.com/urfave/cli/v2\\"\\n\\tactions \\"github.com/yogeshlonkar/go-github-actions\\"\\n\\t\\"gopkg.in/yaml.v2\\"\\n\\n\\t\\"github.com/****/pkg/convert\\"\\n)\\n\\nvar (\\n\\tversion = \\"0.0.0\\" // populated at compile time\\n\\tcommit = \\"HEAD\\" // populated at compile time\\n\\temptyProps = regexp.MustCompile(`(?m): ({}|\\"\\")$`)\\n\\tcommentOnDefault = regexp.MustCompile(`(?m)^(\\\\s*)(default:)$`)\\n\\tcommentOnDetectBranch = regexp.MustCompile(`(?m)^(\\\\s*)(` + convert.DetectBranchOnTagJobID + `:)$`)\\n\\tcommentOnSecret = regexp.MustCompile(`(?m)^(\\\\s*)(.*: \\\\$\\\\{\\\\{\\\\ssecrets.[^G][^L][^O][^B][^A][^L][^_].*)$`)\\n\\tcommentOnDroneComplex = regexp.MustCompile(`(?m)^(\\\\s*)(.*: .*\\\\$\\\\{DRONE_([a-zA-Z0-9_]|([\\\\:\\\\#\\\\/\\\\-\\\\=\\\\?\\\\+\\\\%\\\\^]))*\\\\})`)\\n)\\n\\nfunc main() {\\n\\tlog.SetOutput(os.Stderr)\\n\\tlog.SetFormatter(LogFormatter{})\\n\\tapp := &cli.App{\\n\\t\\tName: \\"drone-to-gha\\",\\n\\t\\tUsage: \\"utility to help migrate drone pipelines to Github actions workflow\\",\\n\\t\\tVersion: version,\\n\\t\\tFlags: []cli.Flag{\\n\\t\\t\\t&cli.BoolFlag{\\n\\t\\t\\t\\tName: \\"std-in-out\\",\\n\\t\\t\\t\\tAliases: []string{\\"io\\"},\\n\\t\\t\\t\\tUsage: \\"use stdin for drone file content and stdout for workflow content\\",\\n\\t\\t\\t},\\n\\t\\t\\t&cli.PathFlag{\\n\\t\\t\\t\\tName: \\"drone-file\\",\\n\\t\\t\\t\\tAliases: []string{\\"d\\"},\\n\\t\\t\\t\\tValue: \\".drone.yml\\",\\n\\t\\t\\t\\tUsage: \\"drone file to convert\\",\\n\\t\\t\\t},\\n\\t\\t\\t&cli.PathFlag{\\n\\t\\t\\t\\tName: \\"output-file\\",\\n\\t\\t\\t\\tAliases: []string{\\"o\\"},\\n\\t\\t\\t\\tValue: \\"github-workflow.yml\\",\\n\\t\\t\\t\\tUsage: \\"output file where converted pipeline will be written to\\",\\n\\t\\t\\t},\\n\\t\\t\\t&cli.BoolFlag{\\n\\t\\t\\t\\tName: \\"debug\\",\\n\\t\\t\\t\\tUsage: \\"enables debug level output\\",\\n\\t\\t\\t\\tHidden: true,\\n\\t\\t\\t},\\n\\t\\t},\\n\\t\\tAction: MainAction,\\n\\t}\\n\\n\\terr := app.Run(os.Args)\\n\\tif err != nil {\\n\\t\\tlog.Fatal(err)\\n\\t}\\n}\\n\\nfunc MainAction(c *cli.Context) error {\\n\\tif c.Bool(\\"debug\\") {\\n\\t\\tlog.SetLevel(log.DebugLevel)\\n\\t\\tlog.Debugf(\\"Commit: %s\\", commit)\\n\\t\\tlog.Debugf(\\"Version: %s\\", version)\\n\\t}\\n\\tvar err error\\n\\tvar workflow *actions.Workflow\\n\\tisStdInOut := c.Bool(\\"std-in-out\\")\\n\\tif isStdInOut {\\n\\t\\tcontent, err := ioutil.ReadAll(os.Stdin)\\n\\t\\tif err != nil {\\n\\t\\t\\treturn err\\n\\t\\t}\\n\\t\\tworkflow, err = convert.ToWorkFlowsFromString(string(content))\\n\\t\\tif err != nil {\\n\\t\\t\\treturn err\\n\\t\\t}\\n\\t} else {\\n\\t\\tdroneFile := c.String(\\"drone-file\\")\\n\\t\\tworkflow, err = convert.ToWorkFlowsFromFile(droneFile)\\n\\t\\tif err != nil {\\n\\t\\t\\treturn err\\n\\t\\t}\\n\\t}\\n\\tyaml.FutureLineWrap()\\n\\tout, err := yaml.Marshal(workflow)\\n\\tif err != nil {\\n\\t\\treturn err\\n\\t}\\n\\tworkflowContent := sanitizeAndComment(string(out))\\n\\tif isStdInOut {\\n\\t\\tfmt.Print(workflowContent)\\n\\t} else {\\n\\t\\tworkflowFile := c.String(\\"output-file\\")\\n\\t\\terr = ioutil.WriteFile(workflowFile, []byte(workflowContent), 0644)\\n\\t\\tif err != nil {\\n\\t\\t\\treturn err\\n\\t\\t}\\n\\t\\tlog.Infof(\\"Coverted pipeline written in %s\\", workflowFile)\\n\\t}\\n\\tif len(workflow.Jobs) > 3 {\\n\\t\\tlog.Infof(\\"Total %d Jobs. You should split the jobs in multiple files\\", len(workflow.Jobs))\\n\\t}\\n\\tlog.Warn(\\"This tool is to provide base workflow/ jobs/ steps from drone pipeline that can be quickly reviewed/ modified to create workflows similar to drone pipeline. Please review each job and step carefully\\")\\n\\treturn err\\n}\\n\\nfunc sanitizeAndComment(workflowContent string) string {\\n\\tworkflowContent = emptyProps.ReplaceAllString(workflowContent, \\":\\")\\n\\tworkflowContent = strings.Replace(workflowContent, \\"\\\\\\"on\\\\\\":\\", \\"on:\\", 1)\\n\\tworkflowContent = commentOnDefault.ReplaceAllString(workflowContent, \\"$1# This job contains steps which didn\'t had any when condition in drone\\\\n$1$2\\")\\n\\tworkflowContent = commentOnDetectBranch.ReplaceAllString(workflowContent, \\"$1# Github actions doesn\'t provide base branch on tag event, this job detects it\\\\n$1$2\\")\\n\\tworkflowContent = commentOnSecret.ReplaceAllString(workflowContent, \\"$1# You need to add this secret to github repo secret\\\\n$1$2\\")\\n\\tworkflowContent = commentOnDroneComplex.ReplaceAllString(workflowContent, \\"$1# Shell parameter expansion is not possible outside of a run step. You need to create an extra step to compute the value into a new variable\\\\n$1$2\\")\\n\\treturn workflowContent\\n}\\n\\ntype LogFormatter struct {\\n}\\n\\nfunc (f LogFormatter) Format(entry *log.Entry) ([]byte, error) {\\n\\tmessage := \\"\\"\\n\\tswitch entry.Level {\\n\\tcase log.TraceLevel:\\n\\t\\tmessage = rainbow.Blue(entry.Message)\\n\\tcase log.DebugLevel:\\n\\t\\tmessage = rainbow.Black(rainbow.BgWhite(entry.Message))\\n\\tcase log.InfoLevel:\\n\\t\\tmessage = rainbow.White(entry.Message)\\n\\tcase log.WarnLevel:\\n\\t\\tmessage = \\"\\u2755 \\" + rainbow.Yellow(entry.Message)\\n\\tcase log.ErrorLevel:\\n\\t\\tmessage = \\"\\u2757\\ufe0f \\" + rainbow.Red(entry.Message)\\n\\tcase log.FatalLevel:\\n\\t\\tmessage = \\"\\ud83d\\udca5 \\" + rainbow.Red(entry.Message)\\n\\t}\\n\\treturn []byte(fmt.Sprintln(message)), nil\\n}\\n","uri":"file://****/****/main.go","version":1}}}'
2021-03-22 17:42:11,819 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":4,"message":"Loading packages..."}}'
2021-03-22 17:42:11,819 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"workspace/configuration","params":{"items":[{"scopeUri":"file://****/****","section":"gopls"}]},"id":1}'
2021-03-22 17:42:11,820 - DEBUG - TX: Sending response: b'Content-Length: 62\r\n\r\n{"id":1,"jsonrpc":"2.0","result":[{"hoverKind":"Structured"}]}'
2021-03-22 17:42:11,871 - INFO - Received filetype completion available request
2021-03-22 17:42:11,928 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2021/03/22 17:42:11 go env for ****/****\\n(root ****/****)\\n(go version go version go1.16.2 darwin/amd64)\\n(valid build configuration = true)\\n(build flags: [])\\nGONOSUMDB=\\nGOPROXY=https://proxy.golang.org,direct\\nGOROOT=/usr/local/Cellar/go/1.16.2/libexec\\nGOINSECURE=\\nGOMOD=****/****/go.mod\\nGOMODCACHE=****/go/pkg/mod\\nGOFLAGS=\\nGOPRIVATE=\\nGOSUMDB=sum.golang.org\\nGOPATH=****/go\\nGONOPROXY=\\nGO111MODULE=\\nGOCACHE=****/Library/Caches/go-build\\n\\n"}}'
2021-03-22 17:42:11,939 - INFO - Server reported: 2021/03/22 17:42:11 go env for ****/****
(root ****/****)
(go version go version go1.16.2 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GONOSUMDB=
GOPROXY=https://proxy.golang.org,direct
GOROOT=/usr/local/Cellar/go/1.16.2/libexec
GOINSECURE=
GOMOD=****/****/go.mod
GOMODCACHE=****/go/pkg/mod
GOFLAGS=
GOPRIVATE=
GOSUMDB=sum.golang.org
GOPATH=****/go
GONOPROXY=
GO111MODULE=
GOCACHE=****/Library/Caches/go-build
2021-03-22 17:42:12,429 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2021/03/22 17:42:12 go/packages.Load\\n\\tsnapshot=0\\n\\tdirectory=****/****\\n\\tquery=[builtin github.com/****/...]\\n\\tpackages=14\\n"}}'
2021-03-22 17:42:12,430 - INFO - Server reported: 2021/03/22 17:42:12 go/packages.Load
snapshot=0
directory=****/****
query=[builtin github.com/****/...]
packages=14
2021-03-22 17:42:12,618 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":3,"message":"Finished loading packages."}}'
2021-03-22 17:42:12,630 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"client/registerCapability","params":{"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"{****/****/internal,****/****/internal/drone,****/****/internal/drone/backend,****/****/internal/drone/backend/docker,****/****/internal/drone/compiler,****/****/internal/drone/linter,****/****/internal/drone/matrix,****/****/internal/drone/types,****/****/internal/yaml,****/****/pkg,****/****/pkg/convert,****/****/pkg/steputil}","kind":7}]}}]},"id":2}'
2021-03-22 17:42:12,680 - ERROR - The language server communication channel closed unexpectedly. Issue a RestartServer command to recover.
Traceback (most recent call last):
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 363, in run
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 518, in _ReadMessages
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 631, in _DispatchMessage
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 609, in _ServerToClientRequest
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 590, in _HandleDynamicRegistrations
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/observers/api.py", line 289, in schedule
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/observers/kqueue.py", line 448, in __init__
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/utils/dirsnapshot.py", line 257, in __init__
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/utils/dirsnapshot.py", line 289, in walk
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/utils/dirsnapshot.py", line 289, in walk
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/utils/dirsnapshot.py", line 289, in walk
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/watchdog_deps/watchdog/build/lib3/watchdog/utils/dirsnapshot.py", line 265, in walk
OSError: [Errno 24] Too many open files: '****/****/.git/objects/61'
2021-03-22 17:42:18,454 - INFO - Received defined subcommands request
2021-03-22 17:42:18,454 - INFO - Found executeCommandProvider support for command ExecuteCommand in go
2021-03-22 17:42:18,455 - INFO - Found codeActionProvider support for command FixIt in go
2021-03-22 17:42:18,455 - INFO - Found definitionProvider support for command GoToDefinition in go
2021-03-22 17:42:18,455 - INFO - Found definitionProvider support for command GoToDeclaration in go
2021-03-22 17:42:18,455 - INFO - Found definitionProvider support for command GoTo in go
2021-03-22 17:42:18,455 - INFO - Found typeDefinitionProvider support for command GoToType in go
2021-03-22 17:42:18,455 - INFO - Found implementationProvider support for command GoToImplementation in go
2021-03-22 17:42:18,455 - INFO - Found referencesProvider support for command GoToReferences in go
2021-03-22 17:42:18,455 - INFO - Found renameProvider support for command RefactorRename in go
2021-03-22 17:42:18,455 - INFO - Found documentFormattingProvider support for command Format in go
2021-03-22 17:42:18,455 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in go
2021-03-22 17:42:18,455 - INFO - Always supporting StopServer for go
2021-03-22 17:42:18,455 - INFO - Always supporting RestartServer for go
2021-03-22 17:42:18,455 - INFO - Always supporting GetDoc for go
2021-03-22 17:42:18,455 - INFO - Always supporting GetType for go
2021-03-22 17:42:18,458 - INFO - Received command request
2021-03-22 17:42:18,458 - INFO - Found executeCommandProvider support for command ExecuteCommand in go
2021-03-22 17:42:18,458 - INFO - Found codeActionProvider support for command FixIt in go
2021-03-22 17:42:18,458 - INFO - Found definitionProvider support for command GoToDefinition in go
2021-03-22 17:42:18,458 - INFO - Found definitionProvider support for command GoToDeclaration in go
2021-03-22 17:42:18,459 - INFO - Found definitionProvider support for command GoTo in go
2021-03-22 17:42:18,459 - INFO - Found typeDefinitionProvider support for command GoToType in go
2021-03-22 17:42:18,459 - INFO - Found implementationProvider support for command GoToImplementation in go
2021-03-22 17:42:18,459 - INFO - Found referencesProvider support for command GoToReferences in go
2021-03-22 17:42:18,459 - INFO - Found renameProvider support for command RefactorRename in go
2021-03-22 17:42:18,459 - INFO - Found documentFormattingProvider support for command Format in go
2021-03-22 17:42:18,459 - INFO - Found workspaceSymbolProvider support for command GoToSymbol in go
2021-03-22 17:42:18,459 - INFO - Always supporting StopServer for go
2021-03-22 17:42:18,459 - INFO - Always supporting RestartServer for go
2021-03-22 17:42:18,459 - INFO - Always supporting GetDoc for go
2021-03-22 17:42:18,459 - INFO - Always supporting GetType for go
Traceback (most recent call last):
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 868, in _handle
return route.call(**args)
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1748, in wrapper
rv = callback(*a, **ka)
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/watchdog_plugin.py", line 97, in wrapper
return callback( *args, **kwargs )
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/hmac_plugin.py", line 62, in wrapper
body = callback( *args, **kwargs )
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/handlers.py", line 94, in RunCompleterCommand
return _JsonResponse( completer.OnUserCommand(
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/completer.py", line 472, in OnUserCommand
return command( self, request_data, arguments[ 1: ] )
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1648, in <lambda>
lambda self, request_data, args: self.GetDoc( request_data )
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/go/go_completer.py", line 84, in GetDoc
result = json.loads( self.GetHoverResponse( request_data )[ 'value' ] )
File "****/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 2330, in GetHoverResponse
raise RuntimeError( 'Server is initializing. Please wait.' )
RuntimeError: Server is initializing. Please wait.
2021-03-22 17:42:21,594 - INFO - Received debug info request
2021-03-22 17:43:10,057 - INFO - Received debug info request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment