Git Product home page Git Product logo

tooling-force.com's People

Contributors

micheletriaca avatar motdotla avatar neowit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tooling-force.com's Issues

ApexRefreshProject and other refresh/deploy commands silently fails

Hi,

ApexRefreshProject and other refresh/deploy commands silently fails. I spent few hrs trying to figure out what is the issue. I'm guessing something related to package.xml file. But as there is no proper error message returned, i'm unable to pin-point the issue.

May I know if there is any option to enable verbose logging?

Thanks

"listSymbols" action

It would be awesome if there was a way to list symbols for a class. This is something sublime text does out of the box. This is really helpful when you want to jump to a single function or get an quick overview of a huge file.

The ideal output would include line # & some type of category so you could filter out to only show functions (sublime doesn't output properties).

zm3urrvb2q

java.lang.NullPointerException while running soqlQuery action

java.lang.NullPointerException
    at com.neowit.utils.JsonUtils$AnyJsonFormat$.write(JsonUtils.scala:18)
    at spray.json.PimpedAny.toJson(package.scala:39)
    at spray.json.CollectionFormats$$anon$3$$anonfun$write$3.apply(CollectionFormats.scala:52)
    at spray.json.CollectionFormats$$anon$3$$anonfun$write$3.apply(CollectionFormats.scala:50)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
    at scala.collection.AbstractTraversable.map(Traversable.scala:104)
    at spray.json.CollectionFormats$$anon$3.write(CollectionFormats.scala:50)
    at spray.json.CollectionFormats$$anon$3.write(CollectionFormats.scala:48)
    at spray.json.PimpedAny.toJson(package.scala:39)
    at com.neowit.utils.ResponseWriter$Message.toJSONObject(ResponseWriter.scala:44)
    at com.neowit.utils.ResponseWriter.println(ResponseWriter.scala:117)
    at com.neowit.apex.actions.SoqlQuery.act(SoqlQuery.scala:117)
    at com.neowit.apex.actions.Action$class.execute(Action.scala:89)
    at com.neowit.apex.actions.AsyncAction.execute(Action.scala:109)
    at com.neowit.apex.Executor.run(Runner.scala:131)
    at com.neowit.apex.Executor.execute(Runner.scala:49)
    at com.neowit.apex.Runner$.main(Runner.scala:33)
    at com.neowit.apex.Runner.main(Runner.scala)

Here is the soql query: SELECT Id FROM Lock__c LIMIT 1

Optional auto-complete interface to allow input & output as string

I'm writing a vs-code plugin to leverage the auto-complete functionality. I've got it working, but I'm having to write my input file (exists as an in memory buffer) and read the output.json.

This is likely adding additional latency to the auto-completion, which should be as low as possible for the best user experience.

I would be nice if I could just pass the currentFileContent as a string parameter and have the response instead written to standard out.

PS: great work on this! Even with a little latency the auto-complete seems to work very well.

Canceling requests to service?

Hey,

Just wondering how you handle the queueing up of multiple listCompletions requests. I'm noticing that if I queue up several requests back to back, the service starts to take longer and longer to respond (likely running out of memory?).

I figure this is something that you've handled in your VIM plugin. Is there someway to cancel the previous listCompletion when new ones come in?

Here what my plugin debugs end up looking like to help you visualize the problem I'm running into.

Sending CMD: --action=listCompletions 
Sending CMD: --action=listCompletions 
Sending CMD: --action=listCompletions 
Sending CMD: --action=listCompletions 

[INFO] Executor - # Time taken: 20.004s

[INFO] Executor - # Time taken: 20.004s

[INFO] Executor - # Time taken: 20.005s

[INFO] Executor - # Time taken: 15.032s


Porting grammar to Typescript

Hey, this isn't really an issue but I'm not sure how else to reach you.

I'm trying to port the apexcode.g4 grammar to typescript. I've pretty much got it to work but I'm running into a little bit of a snag in that I'm not sure how I should update some of the native java code references in the .g4 file:

fragment
JavaLetter
    :   [a-zA-Z$_] // these are the "java letters" below 0xFF
    |   // covers all characters above 0xFF which are not a surrogate
        ~[\u0000-\u00FF\uD800-\uDBFF]
        {Character.isJavaIdentifierStart(_input.LA(-1))}?
    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
        [\uD800-\uDBFF] [\uDC00-\uDFFF]
        {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
    ;

fragment
JavaLetterOrDigit
    :   [a-zA-Z0-9$_] // these are the "java letters or digits" below 0xFF
    |   // covers all characters above 0xFF which are not a surrogate
        ~[\u0000-\u00FF\uD800-\uDBFF]
        {Character.isJavaIdentifierPart(_input.LA(-1))}?
    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
        [\uD800-\uDBFF] [\uDC00-\uDFFF]
        {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
    ;

For example, I need to rewrite this line in javascript: {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}

I can get closer:

{Character.isJavaIdentifierStart(Character.toCodePoint(this._input.LA(-2), this._input.LA(-1)))}

but obviously the Character class isn't part of javascript so those don't compile.

Any help or direction on how I could go about porting these would be greatly appreciated. Or if you could just help me understand what exactly the purpose of these lines are maybe I could take it from there.

Thanks

No documentation for server-mode

In README.md, it says to read :help server-mode in vim-force.com documentation carefully. I do not see server-mode documented anywhere.

Deployment to production silently fails for triggers with 0% code coverage.

Using version 0.3.1.4:

RESULT=FAILURE
#SECTION START: ERROR LIST
#SECTION END: ERROR LIST
MESSAGE: {"id" : 3, "text" : "Code coverage details", "type" : "WARN"}
...
MESSAGE DETAIL: {"messageId" : 3, "text" : "QuoteLineItem: lines total 1; lines not covered 1; covered 0%", "type" : "WARN"}
...
MESSAGE: {"id" : 4, "text" : "Code coverage warnings", "type" : "WARN"}

Idea - alternative implementation of JVM persistence for server mode

Server mode for this tool is killer, to be sure. I was curious about how you implemented that, so I took a look and found it is a web server managed by Akka actors.

I came across Drip the other day and wondered if this project could make use of it. So, instead of "tooling-force.com" creating a web server, we just have clients execute "tooling-force.com" through Drip.

For example, instead of

java -jar tooling-force.com-0.1.jar --action=refresh ...

we have clients do

drip -cp tooling-force.com-0.1.jar --action=refresh ...

Just an idea.

How to pass DeployOptions, like `autoUpdatePackage`?

I want to use the "autoUpdatePackage" option, which is used in other SFDC deploy tools, like Ant Migration tool and JSForce, to be more forgiving of the contents of my source directory and my package.xml file.

The "deployOptions" in conn.deploy(zipFile, deployOptions) in Session.scala#L771 -- is this the same options as the Metadata API's deploy() DeployOptions? If so, we can add some code to Deploy.scala#L257 to pass these options.

It would be nice to set those options from the command line, which would allow vim-force.com plugin to store those config options in Vimscript variables.

ApexRefreshProject and other refresh/deploy commands silently fails

Hi,

ApexRefreshProject and other refresh/deploy commands silently fails. I spent few hrs trying to figure out what is the issue. I'm guessing something related to package.xml file. But as there is no proper error message returned, i'm unable to pin-point the issue.

May I know if there is any option to enable verbose logging?

Thanks

grun not working

I'm trying to compile the project. grun is not working

Here is the command I'm executing

grun Apexcode soqlStatement *.sql

I get the error

Exception in thread "main" java.lang.NoClassDefFoundError: ApexcodeLexer (wrong name: com/neowit/apex/parser/antlr/ApexcodeLexer)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.antlr.v4.runtime.misc.TestRig.process(TestRig.java:153)
    at org.antlr.v4.runtime.misc.TestRig.main(TestRig.java:143)

Same is the case with grun Apexcode compilationUnit *.cls

Check Syntax not returning results

I'm trying to add the "check syntax" feature to my VSCode extension. I'm running the jar in server mode and then sending the following command:

--action=checkSyntax --currentFilePath='path/to/currentfile.cls' --currentFileContentPath='path/to/tempfile.cls' --responseFilePath='path/to/response.json' --projectPath='path/to/project' --pollWaitMillis=1000 --maxPollRequests=1000

The file I'm running it on has the following line in it:

Decimal d = 0

I get a successful response [INFO] Executor - # Time taken: 0.307s and the response.json file is created but only contains RESULT=SUCCESS.

I would expect to get some sort of syntax error on either missing simi-colon. I've tried a couple other things (missing type declaration, missing brace, random junk characters, etc) but can't get anything to return a response.

Add JSON output protocal

Wondering what the thought is behind all the non-json elements in the response files?

RESULT=FAILURE
#SECTION START: ERROR LIST
ERROR: {"filePath":"/Users/jonas/Documents/code/apex-autocomplete/bin/tmp2.cls","line":48,"column":8,"text":"mismatched input '}' expecting {'instanceof', '(', '[', ';', '.', '=', '>', '<', '?', '==', '<=', '>=', '!=', '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', '+=', '-=', '*=', '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>='}"}
#SECTION END: ERROR LIST

It's somewhat of a pain as I have to preprocess the file to remove these lines before passing it through JSON.parse

Seems like a completely JSON structure would be more machine readable. You could include these elements in the structure if they are needed.

{
   success:false,
   errorList:[
     {"filePath":"/src/classes/tmp.cls","line":48,"column":8,"text":"mismatched input '}' expecting {'instanceof', '(', '[', ';', '.', '=', '>', '<', '?', '==', '<=', '>=', '!=', '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', '+=', '-=', '*=', '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>='}"}
  ]
}

DeployAllDestructive review

Hi, I tried to do a code review on the implementation looking at the following diff:
https://github.com/neowit/tooling-force.com/compare/1c5a086f1f312aa42ee9324befd5e769b4f6d421...master?diff=split&name=master
I did this primarily because I plan on testing the deployAllDestructive target soon on a sandbox to make sure it works as expected.

I had some suggestions and questions:

  1. The trigger code for handling removal seems to disable triggers in production rather than creating an empty file and deploying that. Does disabling a trigger not prevent deployments where it would break the trigger body? Say I am removing class A and trigger B. Trigger B references a method in class A so when class A get's created as a stub, the code inside trigger B is disabled but still references that method. Will the deployment still work correctly since we didn't get rid of the code in trigger B that references the method in class A?
  2. The code seems to not handle auto removal of static resources. This metadata type get used a lot for visualforce pages/components. Is there any chance of including support for that type?

Overall looks great, thank you.

Retrieving FieldSets

Is it possible to retrieve Fieldsets using tooling-force?
When I retrieve a managed package object which has fieldsets and validation rules, it does not retrieve any associated fieldsets in the xml.

Failed to create Metadata Container. duplicate value found

I'm getting the following error when using the ApexSaveOne command from "vim-force.com".

Awaiting connection...
Client connected from /127.0.0.1:52707
received command:  --action=saveSpecificFiles --tempFolderPath='/Users/aberg/Temp/vim-forcecom' --config='/Users/aberg/Temp/vim-forcecom/project.properties' --projectPath='/Users/aberg/workspace/sfdc/project' --ignoreConflicts=true --specificFiles='/var/folders/z6/g21f7bkd5sq9_m0sq9zvd3080000gn/T/vPgffQv/3-fileList.txt' --responseFilePath='/Users/aberg/workspace/sfdc/project/.vim-force.com/response_saveSpecificFiles' --pollWaitMillis=1000 --maxPollRequests=1000
[ERROR] Executor - java.lang.IllegalStateException: Failed to create Metadata Container. duplicate value found: Name duplicates value on record with id: 1dc540000008otW
[ERROR] Executor - [Ljava.lang.StackTraceElement;@726a8e0djava.lang.IllegalStateException: Failed to create Metadata Container. duplicate value found: Name duplicates value on record with id: 1dc540000008otW

[Ljava.lang.StackTraceElement;@4cabb279
RESULT=FAILURE
ERROR: {"text":"Failed to create Metadata Container. duplicate value found: Name duplicates value on record with id: 1dc540000008otW"}
Disconnect /127.0.0.1:52707

Press ENTER or type command to continue

I notice that the "1dc540000008otW" Id is the same every time I run this command.

Looks like the metadata container should be deleted on error in the SaveModified class.

I see a logger there, logger.debug("Deleted MetadataContainer; Id=" + container.getId), but I'm not seeing this line in the command's output in the terminal. I spent time looking to see ways to configure the logger, but I can't figure it out.

Any tips? I'm using the latest release of tooling-force.com, btw, tooling-force.com-0.3.6.1.jar.

listcompletions - NullpointerException

Hi Andrey,

i have just started using your vim-force.com plugin, Its awesome. I'm playing with all commands & getting myself familiar.
now, plugin is running in server mode.. i;m trying auto-complete in a apex file. i received null pointer exception in server console. jre version - 1.8.0_25 tooling-force.com version - 0.3.1.4

Client connected from /127.0.0.1:60696
received command: --action=listCompletions --tempFolderPath="C:\Users\deiva\v
im\libraries\force.com\tmp" --config="C:\Users\deiva\vim\libraries\force.
com\properties\at_dev.properties" --projectPath="C:\MyWs\at_dev" --logLevel=Det
ail --column=16 --line=26 --currentFilePath="C:\MyWs\at_dev\src\classes\AccountC
hildDealerContactsController.cls" --currentFileContentPath="C:\Users\deiva\AppDa
ta\Local\Temp\VIDD67C.tmpAccountChildDealerContactsController.cls" --responseFil
ePath="C:\MyWs\at_dev.vim-force.com\response_listCompletions" --pollWaitMillis=
1000 --maxPollRequests=1000
java.lang.NullPointerException
com.neowit.apex.parser.PropertyMember$$anonfun$getModifiers$1.apply(Member.scala
:812)
com.neowit.apex.parser.PropertyMember$$anonfun$getModifiers$1.apply(Member.scala
:812)
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

scala.collection.Iterator$class.foreach(Iterator.scala:727)
scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
scala.collection.AbstractIterable.foreach(Iterable.scala:54)
scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
scala.collection.AbstractTraversable.map(Traversable.scala:105)
com.neowit.apex.parser.PropertyMember$.getModifiers(Member.scala:812)
com.neowit.apex.parser.PropertyMember.getModifiers(Member.scala:841)
com.neowit.apex.parser.PropertyMember.(Member.scala:844)
com.neowit.apex.parser.TreeListener.enterPropertyDeclaration(TreeListener.scala:
94)
com.neowit.apex.parser.antlr.ApexcodeParser$PropertyDeclarationContext.enterRule
(ApexcodeParser.java:1960)
org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:66)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:49)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
com.neowit.apex.parser.SourceScanner$$anonfun$scan$1.apply(SourceScanner.scala:3
9)
com.neowit.apex.parser.SourceScanner$$anonfun$scan$1.apply(SourceScanner.scala:2
3)
scala.collection.immutable.List.foreach(List.scala:318)
com.neowit.apex.parser.SourceScanner.scan(SourceScanner.scala:23)
com.neowit.apex.actions.ScanSource.scan(ScanSource.scala:38)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1$$anonfun$apply$1$$anonfun
$apply$2.apply(ListCompletions.scala:24)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1$$anonfun$apply$1$$anonfun
$apply$2.apply(ListCompletions.scala:15)
scala.Option.map(Option.scala:145)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1$$anonfun$apply$1.apply(Li
stCompletions.scala:15)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1$$anonfun$apply$1.apply(Li
stCompletions.scala:14)
scala.Option.flatMap(Option.scala:170)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1.apply(ListCompletions.sca
la:14)
com.neowit.apex.actions.ListCompletions$$anonfun$act$1.apply(ListCompletions.sca
la:13)
scala.Option.flatMap(Option.scala:170)
com.neowit.apex.actions.ListCompletions.act(ListCompletions.scala:13)
com.neowit.apex.Executor.run(Runner.scala:106)
com.neowit.apex.Executor.execute(Runner.scala:44)
com.neowit.CommandProcessor.processCommand(TcpServer.scala:189)
com.neowit.CommandProcessor$$anonfun$receive$2.applyOrElse(TcpServer.scala:128)
akka.actor.ActorCell.receiveMessage(ActorCell.scala:423)
akka.actor.ActorCell.invoke(ActorCell.scala:397)
akka.dispatch.Mailbox.processMailbox(Mailbox.scala:233)
akka.dispatch.Mailbox.run(Mailbox.scala:215)
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatc
her.scala:506)
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)

scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107
)

Disconnect /127.0.0.1:60696

assembly failing

assembly is failing with NPEs

Here is the stack trace

> assembly
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[trace] Stack trace suppressed: run last test:test for the full output.
[trace] Stack trace suppressed: run last test:test for the full output.
[error] Could not run test com.neowit.apex.SoqlGrammar: java.lang.NullPointerException
[error] Could not run test com.neowit.apex.CodeCompletions: java.lang.NullPointerException
[info] MetaXmlTest:
OK
OK
OK
[info] StubFileGeneratorTest:
[info] - Object type name in Trigger detection 1
[info] - Object type name in Trigger detection 2 - with blank line
[info] - Object type name in Trigger detection 3 - with comments
[info] - Object type name in Trigger detection 4 - with long comments
[info] - Object type name in Trigger detection 5 - with long trigger body
[info] - Object type name in Trigger detection 6 - with multi-line definition
[info] - Object type name in Trigger detection 7 - single line body
[info] ConfigTest:
[info] - No Command Params
[info] - Key without value
[info] - Missing ConfigFile
[info] - Existing config, but missing parameter
[info] - Command Line - Key Without Value #1
[info] - Command Line - Key Without Value #2
[info] - Command Line - Key Without --
[info] - Command Line - value enclosed in quotes --
[info] - Parameter from command line take priority over config
[info] - Parameter from command line take priority over --config
[info] SoqlParserUtilsTest:
[info] - Find FROM in outer select (with nested select)
[info] - Find FROM in outer select (without nested select) #1
[info] - Find FROM in outer select (without nested select) #2
[info] - Find FROM in outer select (without nested select), without WHERE
[info] - Find FROM in outer select (without nested select) with incomplete WHERE
[info] - Find FROM in nested select
[info] - Find FROM in nested select in WHERE part
[info] - Find FROM in nested select (with multiple nested selects)
[info] Run completed in 480 milliseconds.
[info] Total number of tests run: 25
[info] Suites: completed 4, aborted 0
[info] Tests: succeeded 25, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[error] Error during tests:
[error]     com.neowit.apex.SoqlGrammar
[error]     com.neowit.apex.CodeCompletions
[info] Including from cache: commons-logging-1.1.3.jar
[info] Including from cache: apex-34.0.jar
[info] Including from cache: config-1.0.0.jar
[info] Including from cache: spray-json_2.10-1.3.0.jar
[info] Including from cache: force-wsc-34.2.2-uber.jar
[info] Including from cache: antlr-4.5-complete.jar
[info] Including from cache: tooling-34.0.jar
[info] Including from cache: partner-34.0.jar
[info] Including from cache: akka-actor_2.10-2.2-M1.jar
[info] Including from cache: metatdata-34.0.jar
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 4 s, completed Aug 2, 2015 5:14:10 AM

Stack trace

>  last test:test
[debug] Running TaskDef(com.neowit.apex.SoqlParserUtilsTest, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
[debug] Running TaskDef(com.neowit.apex.CodeCompletions, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
[debug] Running TaskDef(com.neowit.apex.SoqlGrammar, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
[debug] Running TaskDef(com.neowit.apex.metadata.StubFileGeneratorTest, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
[debug] Running TaskDef(com.neowit.apex.metadata.MetaXmlTest, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
[debug] Running TaskDef(com.neowit.apex.ConfigTest, org.scalatest.tools.Framework$$anon$1@3bbf0c63, false, [SuiteSelector])
java.lang.NullPointerException
    at com.neowit.apex.CodeCompletions.<init>(CodeCompletions.scala:17)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:621)
    at sbt.TestRunner.runTest$1(TestFramework.scala:76)
    at sbt.TestRunner.run(TestFramework.scala:85)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
    at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
    at sbt.TestFunction.apply(TestFramework.scala:207)
    at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
    at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
    at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
    at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
    at com.neowit.apex.SoqlGrammar.<init>(SoqlGrammar.scala:13)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:621)
    at sbt.TestRunner.runTest$1(TestFramework.scala:76)
    at sbt.TestRunner.run(TestFramework.scala:85)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
    at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
    at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
    at sbt.TestFunction.apply(TestFramework.scala:207)
    at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
    at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
    at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
    at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] Could not run test com.neowit.apex.SoqlGrammar: java.lang.NullPointerException
[error] Could not run test com.neowit.apex.CodeCompletions: java.lang.NullPointerException
[info] Run completed in 480 milliseconds.
[info] Total number of tests run: 25
[info] Suites: completed 4, aborted 0
[info] Tests: succeeded 25, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[debug] Passed tests:
[debug]     com.neowit.apex.ConfigTest
[debug]     com.neowit.apex.metadata.MetaXmlTest
[debug]     com.neowit.apex.SoqlParserUtilsTest
[debug]     com.neowit.apex.metadata.StubFileGeneratorTest
[error] Error during tests:
[error]     com.neowit.apex.SoqlGrammar
[error]     com.neowit.apex.CodeCompletions
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful

Parser blows up if method names match system types

We had a class, SystemClock.cls, which had a method in it called "set" - the full stacktrace is below. I have "resolved" the issue by renaming the method and all references to it for now. I haven't had the full chance to look through your codebase yet, but in the event you get to it before me:

[INFO] SourceScanner - scanning file: SystemClock.cls

failed to add member of parent: SystemClock

[Ljava.lang.StackTraceElement;@741503f6
[ERROR] Executor - java.lang.NullPointerException
[ERROR] Executor - at com.neowit.apex.parser.ClassMethodMember.getMethodName(Member.scala:1146)
[ERROR] Executor - at com.neowit.apex.parser.ClassLikeMember.addChild(Member.scala:452)
[ERROR] Executor - at com.neowit.apex.parser.ApexTreeListener.registerMember(ApexTreeListener.scala:55)
[ERROR] Executor - at com.neowit.apex.parser.ApexTreeListener.enterClassBodyDeclaration(ApexTreeListener.scala:125)
[ERROR] Executor - at com.neowit.apex.parser.antlr.ApexcodeParser$ClassBodyDeclarationContext.enterRule(ApexcodeParser.java:1633)

Running all tests without a project path.

Hi,

I was wondering if there is a way to run all the tests in an org without specifying the project path.

I would like to run all tests in an org on a schedule to notify me whenever there are test failures due to config changes.

Here is what I have so far.

java -jar tooling-force.com-0.3.6.6.jar --action=runTestsTooling --projectPath=$HOME/work/salesforce --responseFilePath=/dev/null --config=./login/sandbox.properties

Thanks for your help.

Completion take long time to return

Hey,

I'm trying to leverage this jar to create a completion extension for vscode.

I've succesfull been able to get the command to run on a project (mavensmate project):

java -jar tooling-force.jar --action=listCompletions --projectPath=/Users/johndoe/proj/ --currentFilePath=/Users/johndoe/proj/src/classes/FooBar.cls --currentFileContentPath=/Users/johndoe/proj/src/classes/FooBar.cls --line=15 --column=13 --responseFilePath=response.json [email protected] --sf.password=pass+st --sf.serverurl=https://test.salesforce.com

However, it takes around 20 seconds to return a result. Is there someway to cache the meta-data? Mavensmate the symbol tables in it's config directory.

Invalidate session.properties if config file is updated

getSavedConnectionData shouldn't return the cached sessionId and serviceEndpoint from session.properties if the config file is newer than the session.properties. When the config file is updated, it should invalidate the session info, and a new session should be started using the current config file.

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.