neowit / vim-force.com Goto Github PK
View Code? Open in Web Editor NEWVim plugin for force.com
Vim plugin for force.com
A bit of a fringe case, but is there an easy way to include the ability to use ApexRefreshProject from a package.xml file? Would make life a lot easier to pull down a new component from editing the package.xml directly.
And I suppose this leads into another question of whether there should be some kind of metadata selector menu. I'm thinking NERD tree styling, and possibly similar to how eclipse manages it. I can imagine it being quite a bit of work though.
Use case:
We are currently treating our git repository as the master rather than what's on the server.
Whenever we remove a file from git/local filesystem and do a deploy all, we have to remove files that we deleted in git after the deployment.
Ask:
It would be nice to have an ApexDeployAll command that also removes remote files that don't live on the local machine. Maybe calling it ApexDeployAllDestructive or ApexDeployAllForce.
Things that probably need to happen are:
Pulling down a list of remote files that relate to each metadata type pulled down, and doing a set difference against the local files.
Andrey, I was curious if there was support for lightning components for vim-force? I've been looking through documentation and I can't seem to figure out how to create a new Lightning App or a new Lightning Component, etc.
Hi,
I have problem with refreshing / saving flow.
Someone has saved file on the server, I would like to save this file from vim.
When I'm trying to save ApexSave
file I get following error:
Operation failed
Outdated file(s) detected.`
xxx.cls => Modified By: xxx; at: 2015-09-21T11:17:53.000Z; Local version saved at: 2015-09-18T10:50:25.000Z`
Use 'refresh' before 'deploy'.
Then when i go with ApexRefreshFile
Remote version is saved in: /home/xxx/force.com-projects/apex/vim-deployment/diffWithRemote/src
No differences between local version and remote Org detected
After this, when i try to save with ApexSave
I'm getting the same error as the first one.
What should to be able to save this file on the server?
[ERROR] Executor - specificTypes is required
Exception in thread "main" com.neowit.utils.MissingRequiredConfigParameterException: specificTypes is required
at com.neowit.utils.BasicConfig.getRequiredProperty(Config.scala:160)
at com.neowit.utils.Config.getRequiredProperty(Config.scala:203)
at com.neowit.apex.actions.BulkRetrieve.getSpecificTypesFile(RetrieveMetadata.scala:486)
at com.neowit.apex.actions.DiffWithRemote$$anon$1.getSpecificTypesFile(RetrieveMetadata.scala:718)
at com.neowit.apex.actions.BulkRetrieve.doRetrieve(RetrieveMetadata.scala:515)
at com.neowit.apex.actions.DiffWithRemote.getDiffReport(RetrieveMetadata.scala:724)
at com.neowit.apex.actions.DeployAllDestructive.act(Deploy.scala:626)
at com.neowit.apex.actions.Action$class.execute(Action.scala:85)
at com.neowit.apex.actions.AsyncAction.execute(Action.scala:105)
at com.neowit.apex.Executor.run(Runner.scala:110)
at com.neowit.apex.Executor.execute(Runner.scala:46)
at com.neowit.apex.Runner$.main(Runner.scala:30)
at com.neowit.apex.Runner.main(Runner.scala)
using tooling-force.com v0.3.4.1 and latest vim-force.com source code
IN does not get highlighted in SOQL queries:
https://github.com/neowit/vim-force.com/blob/master/syntax/apexcode.vim#L72
It seems there are other keywords that are mentioned salesforce guides but not in the syntax file:
https://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_variables.htm
Some that I see:
NOT
IN
the names just need to get added to the following line afaict:
https://github.com/neowit/vim-force.com/blob/master/syntax/apexcode.vim#L63
I cannot find :ApexRefreshFile command from command list, but I can find :ApexRreshProject command. How can I config vim to show :ApexRefreshFile ?
Hi @neowit,
Highlighting for apex stops after any digit in tag's name.
<c:sometext1sometext>
In above example only c:sometext
will be highlighted properly.
It normally won't occur with standard Visualforce tags, but it may when using custom components.
Please see additional examples:
Edit: Actually, first example from above screenshot is invalid, as component name must begin with letter.
Kamil
I've looked at all the settings and properties of my installation and it looks like I'm not missing anything, but when I do :ApexDeployOne deploy myorg
, I get a failure, which looks like it comes SFDC.
java.lang.Exception: UNKNOWN_EXCEPTION msg:UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1157353892-27489 (-824679420)
com.neowit.apex.Session.com$neowit$apex$Session$$waitDeploy(Session.scala:777)
com.neowit.apex.Session$$anonfun$18.apply(Session.scala:581)
com.neowit.apex.Session$$anonfun$18.apply(Session.scala:578)
com.neowit.apex.Session.withRetry(Session.scala:478)
com.neowit.apex.Session.deploy(Session.scala:578)
com.neowit.apex.actions.DeployModified.deploy(Deploy.scala:235)
com.neowit.apex.actions.DeployModified.deploy(Deploy.scala:168)
com.neowit.apex.actions.DeployModified.act(Deploy.scala:147)
com.neowit.apex.actions.Action$class.execute(Action.scala:83)
com.neowit.apex.actions.AsyncAction.execute(Action.scala:98)
com.neowit.apex.Executor.run(Runner.scala:106)
com.neowit.apex.Executor.execute(Runner.scala:44)
com.neowit.apex.Runner$.main(Runner.scala:30)
com.neowit.apex.Runner.main(Runner.scala)
RESULT=FAILURE
ERROR: {"text" : "UNKNOWN_EXCEPTION msg:UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1157353892-27489 (-824679420)"}
I love this Vim plugin you've made, so I really want to resolve this issue, but I don't know where to start. How can I see what is being sent to SFDC when I run this command? Where would you start when debugging this?
Also, when I click after seeing that message, I am given this message
".vim-force.com\response_deploySpecificFiles" [New File]
Cannot open file ".vim-force.com\response_deploySpecificFiles"
and I have to hit again to go back to my Apex file.
I have run a test class with
:ApexTest checkonly AccountTriggerTestClass
Now I've got the coverage results. How do I check what lines of a particular class are uncovered? A video or some helptext on this would be useful.
Thanks.
I'm getting this with commit efd6bfe and tooling-force.com-0.3.3.0.jar on any query (even "select id from case limit 1").
Hi @neowit ,
Do you know any way of storing you username, password and token in a safe way - as far as I know currently it must be saved in plain text file on the hard drive which may be a little bit risky.
Have you considered using oauth in vim-force.com / tooling-force.com ?
Thanks,
Kamil
I've had the ant configuration running for a the last year (this program is a life saver, haven't looked back since I started using this), and have decided to migrate to the new tooling api version.
Looks like a connection issue (what I used to get before configuring proxy settings on ANT). The default configuration on our computers requires to specify proxy settings as auto discover is poked.
Output from running :ApexRefreshProject
C:\WINDOWS\system32\cmd.exe /c "D:\Other\Java\bin\java.exe -Dhttp.proxyHost=172.30.31.50 -Dhttp.proxyPort=3128 -jar d:\Other\vimforce\tooling-force.com-0.1.4.0.jar --action=refresh --tempFolderPath="d:\temp\apex\gvim-deployment" --config="d:\temp\vim-force.com-tests\secure-properties\Dev2.properties" --projectPath="D:\VIMWorkspace\Dev2" --responseFilePath="D:\VIMWorkspace\Dev2.vim-force.com\response_refresh" --pollWaitMillis=1000 --maxPollRequests=1000"
[DEBUG] Connection$ - Creating NEW Partner Connection
[ERROR] Runner$ - com.sforce.ws.ConnectionException: Failed to send request to https://cs18.salesforce.com/services/Soap/m/29.0/00D110000005DS1
com.sforce.ws.ConnectionException: Failed to send request to https://cs18.salesforce.com/services/Soap/m/29.0/00D110000005DS1
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:121)
at com.sforce.soap.metadata.MetadataConnection.describeMetadata(MetadataConnection.java:281)
at com.neowit.apex.Session$$anonfun$5.apply(Session.scala:417)
at com.neowit.apex.Session$$anonfun$5.apply(Session.scala:415)
at com.neowit.apex.Session.withRetry(Session.scala:340)
at com.neowit.apex.Session.describeMetadata(Session.scala:415)
at com.neowit.apex.actions.DescribeMetadata$$anonfun$5.apply(DescribeMetadata.scala:145)
at com.neowit.apex.actions.DescribeMetadata$$anonfun$5.apply(DescribeMetadata.scala:145)
at scala.util.Try$.apply(Try.scala:161)
at com.neowit.apex.actions.DescribeMetadata.loadFromRemote(DescribeMetadata.scala:145)
at com.neowit.apex.actions.DescribeMetadata$.getMap(DescribeMetadata.scala:24)
at com.neowit.apex.actions.DescribeMetadata$.getXmlNameBySuffix(DescribeMetadata.scala:56)
at com.neowit.apex.actions.DescribeMetadata$.isValidApexFile(DescribeMetadata.scala:71)
at com.neowit.apex.actions.ListModified$$anonfun$22.apply(Deploy.scala:770)
at com.neowit.apex.actions.ListModified$$anonfun$22.apply(Deploy.scala:770)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
at com.neowit.apex.actions.ListModified.getModifiedFiles(Deploy.scala:768)
at com.neowit.apex.actions.RefreshMetadata.act(RetrieveMetadata.scala:128)
at com.neowit.apex.Runner$.run(Runner.scala:84)
at com.neowit.apex.Runner$.main(Runner.scala:35)
at com.neowit.apex.Runner.main(Runner.scala)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.java:136)
at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:100)
at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:95)
at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:91)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
... 23 more
[ERROR] Runner$ - ()
[DEBUG] ResponseWriter - RESULT=FAILURE
[DEBUG] ResponseWriter - ERROR: {"text" : "Failed to send request to https://cs18.salesforce.com/services/Soap/m/29.0/00D110000005DS1"}
Hit any key to close this window...
Running Vim 7.3.46 and tooling 0.1.4.0.
configured variables are:
let g:apex_backup_folder="d:\temp\apex\backup"
let g:apex_temp_folder="d:\temp\apex\gvim-deployment"
let g:apex_deployment_error_log="gvim-deployment-error.log"
let g:apex_properties_folder="d:\temp\vim-force.com-tests\secure-properties"
let g:apex_tooling_force_dot_com_path="d:\Other\vimforce\tooling-force.com-0.1.4.0.jar"
let g:apex_binary_tee = "D:\Other\UnxUtils\usr\local\wbin\tee.exe"
let g:apex_binary_touch = "D:\Other\UnxUtils\usr\local\wbin\touch.exe"
let g:apex_ctags_cmd="D:\Other\ctags58\ctags.exe"
let g:apex_API_Version="29.0"
let g:apex_java_cmd="D:\Other\Java\bin\java.exe"
let g:apex_tooling_force_dot_com_java_params="-Dhttp.proxyHost=172.30.31.50 -Dhttp.proxyPort=3128"
It would be great to have a new command ApexCompareAll to compare all files across projects. Even if it works as a traditional diff, it should be enough.
Hello, Looking forward to using this plugin and everything appears to work except Apex CodeCompletion (even visualforce completions appear to work). I've verified that the correct temp file is being passed to the latest (3.1.3) tooling jar with column and row numbers.
I am receiving a response_listCompletions file that contains RESULT=SUCCESS, but is otherwise empty.
Any ideas?
Setup:
Windows 7
VIM - 7.4
YCM
UltiSnips
Eclim
Eclipse + fordotcom IDE,
Hi there,
First of all thanks a bunch for your work on this. I was pulling my hair out using Eclipse and Sublime until I found out this existed. I've used vim-force pretty much every day for the last year or so. As for my question:
I often do ApexDeployOne! deploy <test_sandbox>
to move code into my QA sandbox once I'm finished in my personal dev sandbox.
For my dev sandbox, I can just do ApexSaveOne
and it's pretty fast. Is there a way to allow ApexSave
to accept another org as an argument like ApexDeploy
does? Like, is there a technical reason this isn't available? If it's possible, I could take a stab at it myself and create a PR.
The time taken to save vs deploy is about 5s vs 60s, so it would be pretty handy.
Maybe there's a way to do it and I'm just not seeing it in the documentation.
Thanks,
Mike
I'm trying to figure out the workflow of editing and deploying the contents of a static resource. The zipped-resources doc says:
ApexDeploy
commandI am having problems with step 3. I open the "$PROJECT_DIR/resources-unpacked/MyResource.resource/app.js" file in a buffer in vim, then run the :ApexDeployOne deploy
command, which tries to deploy that exact file. This gives me an error: no valid files in C:\Users\Alex\AppData\Local\Temp\VIFE452.tmp-fileList.txt
(it contains "resources-unpacked/MyResource/app.js").
I'm guessing I'm doing this wrong. I'm guessing I need to deploy the "src/staticresources/MyResource.resource" file. Yeah?
It looks like the only way to do that is to manually type that path into the :ApexStage
command, then do :ApexDeployStaged deploy
, right? This seems more complicated than it should be. :3
What do you think about this proposed change? - Change the :ApexDeployOne
command to check if the current file is in the "resources-unpacked" directory, and map deploy requests to those files to their corresponding "src/staticresources/*" file? For example: I tell it to deploy "resources-unpacked/MyResource.resource/app.js", but it actually generates a command to deploy the "src/staticresources/MyResource.resource" file.
I work on an org that has a reasonably sizeable code base. Generally speaking I like to pull all classes, visualforce pages, triggers, etc. When running :ApexRefreshProject, and once it recieves the result, it looks as though it copies each file one by one. From my understanding each call using vimrun spawns a new command prompt window (limitation of GVIM yes?). It's pretty fun watching the windows open/close, however i have a feeling that the display redraw makes this take much longer than needed.
This wouldn't be such a problem if I only selected a small number of files to work on locally, however I generally look at the entire code base for troubleshooting etc, and having it all in vim makes my life somewhat easier.
I feel as though the old Ant implementation used to copy all the files en masse, or directly into the directory on refresh. Is there a way to implement something similar to this or are we stuck on this one?
On another side issue, if an object has a bad character in its name (* for example), then this causes the refresh to fail (by object, I mean things like page layouts, profiles, etc where an API name doesn't exist). The Ant implementation escaped these by using % and a hex code for the character.
If we still employed the person that decided putting an asterisk in the name of an object was a good idea, then I'd have some fairly choice words for them. Needless to say, I'm fixing most of these up, but their code also has some hard references in it which leads me to just ignore it most of the time.
Quickly saying thank you for this project. I've used it for over a year now, and it's become an important part of my workflow.
Thanks again!
I had to add the following in syntax/apexcode.vim
-syn match apexcodeSystemKeywords "Database\.\(convertLead\|countQuery\|emptyRecycleBin\|executeBatch\|getQueryLocator\|query\|rollback\|setSavepoint\)"
+syn match apexcodeSystemKeywords "Database\.\(convertLead\|countQuery\|emptyRecycleBin\|executeBatch\|getQueryLocator\|QueryLocator\|query\|rollback\|setSavepoint\)"
Thanks for a great plugin, by the way. Super happy to have something for Vim.
I have the following class, which I can't seem to test:
public class ShippingControllerTest {
static testMethod void helloTest() {
ShippingController sc = new ShippingController();
System.assertEquals('hello', sc.hello());
}
}
I run :ApexTest
, and get the following output:
Vim(sign):E474: Invalid argument
Select Log Type
1. None
2. Debugonly
3. Db *
4. Profiling
5. Callout
6. Detail
Type number and <Enter> (empty defaults to "Db"):
Then...
Press ENTER or type command to continue
zsh:1: no matches found: --testsToRun=*
shell returned 1
Then...
".vim-force.com/response_deployModified" [New File]
Cannot open file ".vim-force.com/response_deployModified"
".vim-force.com/response_deployModified" [New File]
Cannot open file ".vim-force.com/response_deployModified"
Operation failed
".vim-force.com/response_deployModified" [New File]
Cannot open file ".vim-force.com/response_deployModified"
".vim-force.com/response_deployModified" [New File]
Cannot open file ".vim-force.com/response_deployModified"
".vim-force.com/response_deployModified" [New File]
Cannot open file ".vim-force.com/response_deployModified"
Have I set anything up incorrectly, or is this a bug?
Hey there, I was SO overjoyed when I discovered that this existed. I got it to work for the most part but for some reason, syntax highlighting isn't working for me. I've followed your instructions and put the following in my .vimrc:
set nocompatible
filetype plugin on
syntax on
I'm on Vim 7.4 on a Mac.
I was curious if you know why this might be happening?
When an apex class contains a field declared like this it shows up in the taglist:
public String myField;
However, it does not work for fields with getters/setters declared like this:
public String myField {
get;
set;
}
I get the following when I hit the command :ApexRefreshProject
Error detected while processing function apex#refreshProject..apexAnt#refresh..apexAnt#execute:
line 1:
E121: Undefined variable: g:apex_properties_folder
E116: Invalid arguments for function apexOs#removeTrailingPathSeparator(g:apex_properties_folder)
E15: Invalid expression: apexOs#removeTrailingPathSeparator(g:apex_properties_folder)
line 5:
E121: Undefined variable: propertiesFolder
E116: Invalid arguments for function apexOs#joinPath([propertiesFolder, a:projectName]) . ".properties"
E15: Invalid expression: apexOs#joinPath([propertiesFolder, a:projectName]) . ".properties"
line 6:
E121: Undefined variable: projectPropertiesPath
E116: Invalid arguments for function filereadable(projectPropertiesPath)
E15: Invalid expression: !filereadable(projectPropertiesPath)
Error detected while processing function apex#refreshProject..apexAnt#refresh..apexAnt#execute..apexOs#createTempDir..apexOs#getTempFolder:
line 1:
E121: Undefined variable: g:apex_temp_folder
E15: Invalid expression: g:apex_temp_folder
E121: Undefined variable: g:apex_temp_folder
E15: Invalid expression: g:apex_temp_folder
Error detected while processing function apex#refreshProject..apexAnt#refresh..apexAnt#execute:
line 15:
E121: Undefined variable: g:apex_deployment_error_log
E116: Invalid arguments for function apexOs#joinPath([tempDir, g:apex_deployment_error_log])
E15: Invalid expression: apexOs#joinPath([tempDir, g:apex_deployment_error_log])
line 24:
E121: Undefined variable: propertiesFolder
E116: Invalid arguments for function shellescape(propertiesFolder)
E15: Invalid expression: s:ANT_CMD . " -buildfile " . shellescape(buildFile). " -Ddest.org.name=" . shellescape(orgName) . " -Dproperties.path=" . shellescape(propertiesFolder)
line 27:
E121: Undefined variable: antCommand
E15: Invalid expression: antCommand . " -DpollWaitMillis=" . g:apex_pollWaitMillis
line 36:
E121: Undefined variable: antCommand
This is a bit of a minor one, but would help none the less. From what I can see, I can't use tilde in the variables used to mark where the tooling jar, and other properties folders are.
This won't work:
let g:apex_tooling_force_dot_com_path="~/.vim/tooling-force.com.jar"
This does:
let g:apex_tooling_force_dot_com_path="/home/naylorb/.vim/tooling-force.com.jar"
I'm trying to standardise the development environments I'm using, and putting my vimrc into a github that I can just pull down when I want to set up my new environment. It just so happens that my work nix username isn't the same as my home one. Since everything is in my home dir, it just causes these minor issues. Is there a way to allow ~, or any other way that you know that can discover the home dir to avoid putting a explicit reference in my vimrc for this?
They should be highlighted just as any other keyword, i.e. new
, return
etc.
Hi Andrew,
Thanks a lot for the great plugin. I'm trying to run force.com vim commands from console directly.
i,e, for ex,
vim -c ApexInitProject
(or)
vim -c ApexCompare
It's working fine. But, After the command execution, it ends up in VI editor. Is there anyway, to redirect output of vim directly to Console. So that, VI doesn't get open at all ?
I can't seem to find a command to create a new custom object. When I try to save the .object
file, it complains that common attributes (e.g. externalId
, label
) are invalid.
Creating the object, later modifying the metadata to match what I'm attempting in vim-force and saving to Salesforce, all in Eclipse, works without issue, though.
I'm sure I'm missing something, but I just can't seem to find it.
Any time I use ApexLog it says "No Log file available".
vim-force.com is working. I can edit, ApexSave, ApexDeploy, and use ApexQuery with ApexScratch.
I have debug logs turned on for my dev user account on Salesforce and can view new logs on Salesforce.com website/dev console.
It would be nice if the following list of keywords were highlighted in soql blocks:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Hello,
java.nio.charset.UnmappableCharacterException is thrown when trying to execute anonymous block with certain special characters. (Deploy works correctly.)
Sample code:
String hashBase = 'árvíztűrő tükörfúrógép|ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP';
Tooling version: 0.3.3.2, SFDC API version: 32.0
vim-force.com : commit 503baa9
Regards,
Gabor
Currently, there is no documentation on the format for .properties files that are supposed to contain your login credentials. The documentation says in a couple of places to reference the 'force.com-settings' section, but that section does not specify the format of these .properties files.
It would be nice to be able to retrieve specific Salesforce components from within vim. It's typical for package.xml
to contain wildcards for all of the components. Unfortunately, this doesn't retrieve everything, such as custom fields on standard objects.
I'd like to be able do something like: :ApexRetrieve object Account
, which would generate the package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account</members>
<name>CustomObject</name>
</types>
<version>24.0</version>
</Package>
and run the retrieveSource
target against it.
currently true/false do not get highlighted inside of a soql query
Hi @neowit ,
Is there a reason why Apex(Save/Deploy)One has additional confirmation like:
Following files will be included
foo/bar.cls
Proceed? [y/N]
I would expect such message before saving multiple files(i.e. ApexSave), not when saving current file.
Would be nice to introduce some sort of command to load one of existing projects.
Right now we need to execute all commands with one of project's files opened.
For example, I usually switch constantly between: project files, ApexScrach file and todo file.
It would be nice if I can execute ApexSave for my "loaded" project, without checking if my current buffer is one of the project's files.
Some example shortcuts proposed by you in doc will also benefit from 'loaded' project:
nmap <leader>sc :noautocmd vimgrep /\<<C-R><C-W>\>/j PROJECTBASEPATH/**/*.cls PROJECTBASEPATH/**/*.trigger <CR>:cwin<CR>
I'm a beginner vim & vim-force.com user and I'm not sure if it is possible to create such 'global' variable that could store loaded project path. So both points 2 & 3 may be impossible to do.
Test Suites were just launched in Spring 16. Some support for them would be super helpful.
Usecase: I have a particular feature that I want to run a set of tests on to check the coverage for my feature.
It looks like the test suites are stored in new ApexTestSuite
and TestSuiteMembership
objects, so maybe a query to that, and a run all tests on it? I'm not sure what they'll be adding to the API to support this directly. With some luck you can just call a the ApexTestSuite as part of the tooling API for testing.
I just upgraded to the latest branch and upgraded my vim to VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2016 05:49:50). Also downloaded and replaced the latest tooling.jar file.
However my basic commands arent working. ApexRefreshProject or ApexRetrieve both fail. Here is the output of ApexRefreshProject -
--action=refresh --tempFolderPath='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/temp_folder' --config='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/properties_folder/sfdcjune.properties' --projectPath='/Users/ahegde/releases/sfdcjune' --responseFilePath='/Users/ahegde/releases/sfdcjune/.vim-force.com/response_refresh' --pollWaitMillis=1000 --maxPollRequests=1000
Trying to start server using command: java -Dorg.apache.commons.logging.simplelog.showlogname=false -Dorg.apache.commons.logging.simplelog.showShortLogname=false -Dorg.apache.commons.logging.simplelog.defaultlog=info -Dfile.encoding=UTF-8 -jar /Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/tooling-force.jar --action=serverStart --port=8888 --timeoutSec=60
--action=refresh --tempFolderPath='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/temp_folder' --config='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/properties_folder/sfdcjune.properties' --projectPath='/Users/ahegde/releases/sfdcjune' --responseFilePath='/Users/ahegde/releases/sfdcjune/.vim-force.com/response_refresh' --pollWaitMillis=1000 --maxPollRequests=1000
[INFO] # Time taken: 0.098s
ERROR: Operation failed
--action=refresh --tempFolderPath='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/temp_folder' --config='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/properties_folder/sfdcjune.properties' --projectPath='/Users/ahegde/releases/sfdcjune' --skipModifiedFilesCheck=true --responseFilePath='/Users/ahegde/releases/sfdcjune/.vim-force.com/response_refresh' --pollWaitMillis=1000 --maxPollRequests=1000
[INFO] waiting result, poll #2
[INFO] waiting result, poll #4
[INFO] waiting result, poll #6
[INFO] waiting result, poll #8
[INFO] waiting result, poll #10
[INFO] waiting result, poll #12
[INFO] waiting result, poll #14
[INFO] waiting result, poll #16
[INFO] waiting result, poll #18
[INFO] waiting result, poll #20
[INFO] waiting result, poll #22
[INFO] waiting result, poll #24
[INFO] retrieving Metadata ZIP ...
[INFO] retrieving Metadata ZIP ... # elapsed: 3s
************************************
press 'q' to close this buffer
************************************
Output of ApexRetrieve for Trigger, Class and Page -
--action=bulkRetrieve --tempFolderPath='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/temp_folder' --config='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/properties_folder/sfdcjune.properties' --projectPath='/Users/ahegde/releases/sfdcjune' --typesFileFormat=json --updateSessionDataOnSuccess=true --specificTypes='/var/folders/mp/_xd44n411yd7r3l9bzxp8jn800129w/T/vaD37v8/0' --responseFilePath='/Users/ahegde/releases/sfdcjune/.vim-force.com/response_bulkRetrieve' --pollWaitMillis=1000 --maxPollRequests=1000
Trying to start server using command: java -Dorg.apache.commons.logging.simplelog.showlogname=false -Dorg.apache.commons.logging.simplelog.showShortLogname=false -Dorg.apache.commons.logging.simplelog.defaultlog=info -Dfile.encoding=UTF-8 -jar /Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/tooling-force.jar --action=serverStart --port=8888 --timeoutSec=60
--action=bulkRetrieve --tempFolderPath='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/temp_folder' --config='/Users/ahegde/.vim_runtime/sources_non_forked/force_config_folder/properties_folder/sfdcjune.properties' --projectPath='/Users/ahegde/releases/sfdcjune' --typesFileFormat=json --updateSessionDataOnSuccess=true --specificTypes='/var/folders/mp/_xd44n411yd7r3l9bzxp8jn800129w/T/vaD37v8/0' --responseFilePath='/Users/ahegde/releases/sfdcjune/.vim-force.com/response_bulkRetrieve' --pollWaitMillis=1000 --maxPollRequests=1000
[INFO] retrieve: ApexClass
[INFO] waiting result, poll #2
[INFO] waiting result, poll #4
[INFO] waiting result, poll #6
[INFO] waiting result, poll #8
[INFO] waiting result, poll #10
[INFO] waiting result, poll #13
[INFO] waiting result, poll #15
[INFO] waiting result, poll #17
[INFO] retrieving Metadata ZIP ...
[INFO] retrieving Metadata ZIP ... # elapsed: 3s
[INFO] retrieving Metadata ZIP ... # elapsed: 6s
[INFO] retrieving Metadata ZIP ... # elapsed: 9s
[INFO] retrieving Metadata ZIP ... # elapsed: 12s
[INFO] retrieving Metadata ZIP ... # elapsed: 15s
[INFO] retrieve: ApexTrigger
************************************
press 'q' to close this buffer
************************************
What could be the issue here?
It would be nice to have the same functionality that the Force.com IDE has as far as a pre-deploy step to check if the Last Modified Date of the backup file is the same as the Last Modified Date of the server file.
If the Last Modified Dates are the same, then we know no server changes have been made, so we proceed with the deploy.
Otherwise, we alert that "The file on the server has been modified after your last refresh." or something of that nature.
Hi @neowit,
Recently it struck me that indentation with =
operator doesn't work for VF tags. I've looked trough .indent/visualforce.vim
as well as ./runtime/indent/html.vim
and it seems that only tags hardcoded in html.vim
are indented, and there is no nice way of reusing logic from this file, due to script scope of variable holding the tags.
Even if there was a way of injecting tags to s:indent_tags
of html.vim
there are two problems:
:
sign, and everything after, so all apex tags are read as apex
instead of i.e. apex:page
.html.vim
- either tag is indented or not(example <p/>
tag won't cause indentation of following lines, but also everything between tags <p>
and </p>
won't be indented.My questions are:
Am I missing something?
Did it ever worked?
Did you consider working on script for indentation of VF tags?
Currently all vim-force.com commands block the UI. I'd like to be able to continue looking at code while a deploy is executing, as deploys can take >1 min.
Neovim has a job-control thing which enables a plugin to spawn a background process. I recall seeing a plugin which wraps this in a backward compatible way.
Have you thought about running these vim-force.com commands asynchronously?
Is anyone facing this same problem?
since webservice is a keyword: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_web_services_methods_considerations.htm
This is a valid type as described here:
Unfortunately Database.Upsert gets highlighted and Result remains unhighlighted.
This is due to Database.upsert() being a valid function.
I think the expected highlighting would be to highlight Database.upsert but none of Database.UpsertResult
An "all" mode for apex#MakeProject would be useful, for example, when deploying a project to a new org.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.