GithubHelp home page GithubHelp logo

dontshavetheyak / groovy-guru Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 4.0 871 KB

Groovy Intellisense for Visual Studio Code

Home Page: https://moonshine-ide.com/

License: Apache License 2.0

Python 15.25% TypeScript 68.01% JavaScript 7.41% Dockerfile 9.32%
ide intelisense vscode-extension

groovy-guru's People

Contributors

asual avatar dependabot[bot] avatar joshtynjala avatar lhein avatar renovate[bot] avatar sciencesakura avatar shadycuz avatar whateverdood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

groovy-guru's Issues

Invalid duplicate class definition of class Jenkinsfile

VSCode version: 1.64.1
Groovy-Guru version: v0.6.0

Issue:
IntelliSense errors due to second Jenkinsfile (in a differrent folder) in workspace.
image

Description:
I am working on two projects at the same time and it's convenient for me to keep them in one workspace (VSCode window), but extension cannot correctly recognize two folders inside workspace root as two separate subprojects, so I have the error above.

Example:
workspace/project1/Jenkinsfile
workspace/project2/Jenkinsfile
The error will be in the second Jenkinsfile, so Intellisense will not work.

Expect:
Some settings or solution so that the extension divides the IntelliSense into subprojects or namespaces.

Illegal argument: line must be non-negative

I just downloaded this extension for VSCode and it fails to start.

My VSCode version:

Version: 1.58.2 (user setup)
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:10:15.214Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19041

The error that appeared in Output: Log (Window) sanitized

[2021-07-23 11:41:45.436] [renderer1] [error] Illegal argument: line must be non-negative: Error: Illegal argument: line must be non-negative
	at Object.P [as illegalArgument] (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:5:1232)
	at new b (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:77:15809)
	at new b (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:77:15222)
	at R (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:177776)
	at C (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:177849)
	at K (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:182143)
	at c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:187550
	at Array.map (<anonymous>)
	at Object.asSymbolInformations (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:187542)
	at c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:113599
[2021-07-23 11:41:46.457] [renderer1] [error] Illegal argument: line must be non-negative: Error: Illegal argument: line must be non-negative
	at Object.P [as illegalArgument] (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:5:1232)
	at new b (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:77:15809)
	at new b (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:77:15222)
	at R (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:177776)
	at C (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:177849)
	at K (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:182143)
	at c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:187550
	at Array.map (<anonymous>)
	at Object.asSymbolInformations (c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:187542)
	at c:\Users\User\.vscode\extensions\dontshavetheyak.groovy-guru-0.1.2\build\extension.js:1:113599

I'm not really sure what else to include. Let me know if you need any other information.

Unable to see what the extension is doing

I often have to restart the extension and when I do, I don't know if the extension is working again on not. It would be nice if the extension had a status bar like a lot of other extensions do.

Is this extension supported on Mac?

Hello,

Curious if this extension is supported on a Mac M1. No matter what JDK path I put in "groovy.java.home" param of the settings file, I get the error: "The groovy.java.home setting does not point to a valid JDK".

Thanks in advance

Bundle the JAR with the extension

Just a suggestion. I do this with the ShellCheck extension, and by doing so you would be able to remove the dependency on the file downloader and further interactions with the user about downloading the language server.

Awesome initiative btw!

Javadoc comment formatting

VSCode Version: 1.71
Groovy-Guru Version: 0.6.0

Issue:
Additional * in tooltip comment
Text on new line is not reflected in the comment

image

Expect:
The comments beginning * should not be present in the tooltip comment
Text that is separated by a new line should be on a new line in the tooltip comment

Example Code:

class MyClass {
    /**
    * Test
    * Newline
    * @author test
    */
    void test(String test) {
        println('test' + test)
    }
}

Replication:
I can replicate this issue 100% of the time after version 0.5.0
This issue doesn't seem to be present in 0.4.0 although the comments dont seem quite right in that version either since everything is in a nested bullet point list

How to prevent the extension from checking files in `bin` folder?

I use Gradle in my project, and because of that, gradle generates some build output in a folder called bin. The extension wrongly sees my source files as being defined there as well:

Invalid duplicate class definition of class com.company.internal.river.jenkinssharedlibrary.MBReportJobStart : The sources /local/home/user/repos/jenkins-shared-library/src/com/company/internal/river/jenkinssharedlibrary/MBReportJobStart.groovy and /local/home/user/repos/jenkins-shared-library/bin/main/com/company/internal/river/jenkinssharedlibrary/MBReportJobStart.groovy each contain a class with the name com.company.internal.river.jenkinssharedlibrary.MBReportJobStart.
 @ line 11, column 1.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm vsce Unavailable
npm vscode-test Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update actions/setup-python action to v2.3.4
  • Update dependency @types/node to v14.18.63
  • Update actions/checkout action to v2.7.0
  • Update typescript-eslint monorepo to v4.33.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • Update actions/checkout action to v4
  • Update actions/setup-java action to v4
  • Update actions/setup-node action to v4
  • Update actions/setup-python action to v5
  • Update dependency @types/glob to v8
  • Update dependency @types/node to v20
  • Update dependency eslint to v9
  • Update dependency glob to v11
  • Update dependency mocha to v10 (mocha, @types/mocha)
  • Update dependency semver to v3
  • Update dependency typescript to v5
  • Update dependency vsce to v2
  • Update dependency vscode-languageclient to v9
  • Update dependency webpack-cli to v5
  • Update mcr.microsoft.com/vscode/devcontainers/javascript-node Docker tag to v1
  • Update mcr.microsoft.com/vscode/devcontainers/typescript-node Docker tag to v1
  • Update release-drafter/release-drafter action to v6
  • Update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
  • mcr.microsoft.com/vscode/devcontainers/typescript-node 0-16-bullseye
.devcontainer/base.Dockerfile
  • mcr.microsoft.com/vscode/devcontainers/javascript-node 0-16-bullseye
github-actions
.github/workflows/pr_label.yml
  • jesusvasquez333/verify-pr-label-action v1.4.0
  • jesusvasquez333/verify-pr-label-action v1.4.0
.github/workflows/release.yml
  • actions/checkout v2.4.2
  • actions/setup-python v2.3.2
  • WyriHaximus/github-action-get-previous-tag v1
  • richardsimko/update-tag v1
  • release-drafter/release-drafter v5.15.0
  • release-drafter/release-drafter v5.15.0
  • actions/checkout v2.4.2
  • actions/setup-java v2
  • actions/setup-node v2
  • svenstaro/upload-release-action v2
  • svenstaro/upload-release-action v2
.github/workflows/test.yml
  • actions/checkout v2.4.2
  • actions/setup-java v2
  • actions/setup-node v2
npm
package.json
  • vscode-languageclient 7.0.0
  • @types/glob 7.1.4
  • @types/mocha 8.2.3
  • @types/node 14.18.26
  • @types/vscode 1.59.0
  • @typescript-eslint/eslint-plugin 4.29.1
  • @typescript-eslint/parser 4.29.1
  • eslint 7.32.0
  • glob 7.1.7
  • mocha 8.4.0
  • ovsx 0.3.0
  • pre-commit 1.2.2
  • ts-loader 9.2.5
  • typescript 4.3.5
  • vsce 1.96.1
  • vscode-test 1.6.1
  • webpack 5.49.0
  • webpack-cli 4.7.2
  • vscode ^1.59.0
pip_requirements
.scripts/requirements.txt
  • requests ==2.25.1
  • semver ==2.13.0

  • Check this box to trigger a request for Renovate to run again on this repository

Automatic dependency/classpath handling with maven

Good work so far, this extension looks promising.

But, I have a maven Groovy project (Jenkins shared library) and there are around 14000 files in the maven repo cache with direct and indirect dependencies of various versions of Jenkins and their plugins. It would be nice if adding every JAR file would not be required and the extension would detect maven and use its repo cache and searched it for the required JARs.

Right now I am facing many java.lang.NoClassDefFoundError or squiggly lines everywhere. All in all I think it's around 10-50 JARs, but it's cumbersome to adjust the list in extension settings as soon as a dependency tree changes versions.

Go to definition for @Fields and def fails

When selecting Go to Definition on a @Field definition for a Jenkinsfile it fails with:

Cannot read properties of undefined (reading 'with')

This should be a minimal example, if you select MYFIELD use.

import groovy.transform.Field

@Field final MYFIELD = 'SomeValue'

def variable = 'otherValue'

if (variable == MYFIELD) {
    echo 'Value matches.'
}

Language Server won't start

I cannot get the language server to start. The message I get is simply "Internal Error" The Output from Language Server is empty, the thumb is down, and I cannot get any other information.

I'm in a bit of a different scenario with my environment - I run VSCode on a windows-based desktop, but I use remoteSSH to an Ubuntu 20.08 Server host that is on my network, which is where I do all of my work.

Java is installed on both host and guest, and I've tried the path for both Windows and Ubuntu installs, and I get the same result.

What really gets me is that, despite adding the logging: verbose option that I saw in another issue thread, the output is still completely blank.

Anything else I could be missing?

Only download language server once

I just noticed every time the language server starts, the extension is re-downloaded. We should check if the binary exists locally and if it does reuse it.

Unable to access jarfile on Windows

Expected Behavior

Groovy LSP starts correctly on Windows.

Actual Behavior

The extension successfully downloads groovy-language-server-X.X.X-all.jar (in my case at C:\Users\Admin\AppData\Roaming\Code\User\globalStorage\dontshavetheyak.groovy-guru\file-downloader-downloads\groovy-language-server-0.1.1-all.jar). However, it does not find it:

image

Groovy Language Server output:

Error: Unable to access jarfile /c:/Users/Admin/AppData/Roaming/Code/User/globalStorage/dontshavetheyak.groovy-guru/file-downloader-downloads/groovy-language-server-0.1.1-all.jar
[Info  - 22:20:45] Connection to server got closed. Server will restart.
[Error - 22:20:45] Connection to server is erroring. Shutting down server.
Error: Unable to access jarfile /c:/Users/Admin/AppData/Roaming/Code/User/globalStorage/dontshavetheyak.groovy-guru/file-downloader-downloads/groovy-language-server-0.1.1-all.jar

Steps to Reproduce the Problem

  1. Open a workspace with a .groovy file on Windows

Possible solutions

There is an extra / at the begining of the path being resolved: /c:/Users/Admin/AppData/Roaming/Code/User/globalStorage/dontshavetheyak.groovy-guru/file-downloader-downloads/groovy-language-server-0.1.1-all.jar.

Environment

  • OS: Windows 10
  • Extension version: 0.1.1
  • Installation method: VSCode Marketplace

Very high CPU usage on remote

I have this extension installed on a remote machine. I'm not sure why, but it has a very high cpu utilization. It is worth mentioning that this repo I am using is very big, so maybe that's why.

Screen Shot 2022-08-22 at 12 34 59 PM

OpenJDK version

In Groovy Language Server Output I see error. Which openjdk version I should install on my machine?

Jul 02, 2024 4:59:31 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleNotification
WARNING: Notification threw an exception: {
  "jsonrpc": "2.0",
  "method": "workspace/didChangeConfiguration",
  "params": {
    "settings": {
      "groovy": {
        "java": {}
      }
    }
  }
}
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.IllegalArgumentException: Property must not be null: start
	at org.eclipse.lsp4j.util.Preconditions.checkNotNull(Preconditions.java:29)
	at org.eclipse.lsp4j.Range.<init>(Range.java:41)
	at net.prominic.groovyls.util.GroovyLanguageServerUtils.syntaxExceptionToRange(GroovyLanguageServerUtils.java:69)
	at net.prominic.groovyls.GroovyServices.lambda$handleErrorCollector$4(GroovyServices.java:491)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
	at net.prominic.groovyls.GroovyServices.handleErrorCollector(GroovyServices.java:488)
	at net.prominic.groovyls.GroovyServices.compile(GroovyServices.java:478)
	at net.prominic.groovyls.GroovyServices.updateClasspath(GroovyServices.java:205)
	at net.prominic.groovyls.GroovyServices.didChangeConfiguration(GroovyServices.java:185)
	... 16 more

Jul 02, 2024 4:59:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 3

extension activates but auto-completeion isn't working

Hi,

I tried many times but the code suggestion didn't appear when I type.
I tried exactly the same as your demo on the main page, but it doesn't work.
The language server run and took over 800MB of RAM.
image
I download and set the lib path to groovy SDK lib, but it still doesn't work.
Did I miss something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.