Giter Club home page Giter Club logo

vim-force.com's Introduction

Vim plugin for developing on force.com

salesforce.com / force.com plugin for Vim version 7.4 (with job & channel support) or later.

Update September 2023

Note 1: Vim 9 release contains a bug 11534 which breaks vim-force.com plugin. Use Vim 8.2 release or nightly build of Vim 9, e.g. v9.0.1950.

Update September 2016

Note 1:
Majority of plugin functions have been migrated to async jobs and channels added in vim not so long ago.
You may need to update to a very recent version of your vim flavour because some initial versions (e.g. MacVim) with job support had problems with properly handling this functionality.
As always - make sure that you use latest tooling-force.com.jar.

Note 2: Minimum MacVim version which is known to (almost) work is 7.4, Included patches: 1-1831.
Current versions of MacVim GUI (as well as GVim) suffer from this issue.
The problem only manifests itelf if your java & tooling-force.com.jar config is wrong. If in doubt - test your config with :ApexValidateJavaConfig

Note 3:
This version has not been fully tested on MS Windows yet.
If you want to try it out - make sure to use latest vim version.

Note 4:
If you have to use older vim version or want to continue using synchronous version of all commands then switch to legacy-vim-sync branch.

Update July 2015

If you do not get code coverage data when running :ApexTestWithCoverage using one of meta-* flags then you are most likely affected by a bug in Metadata API Summer'15.
Workaround 1: use :ApexTestWithCoverage with tooling-sync or tooling-async flag.
Workaround 2: fall back to tooling-force.com-0.3.3.3.jar. Note: you will lose some of newer functions.

Update March 2015

If you are getting Internal Server Error when trying to deploy/save list of files which contain both Aura bundle(s) and Apex Class/Page then you are most likely affected by what appears to be a bug in Spring'15. Current workaround is to deploy Apex Classes/Pages first (:ApexDeployOne or :ApexDeployOpen or :ApexDeployStaged) and then call :ApexDeploy or :ApexSave as usual.

Update Feb. 2014

'master' branch of vim-force.com is no longer based on Ant and force.com migration tool. This version requires config changes, see :help force.com-installation, :help g:apex_tooling_force_dot_com_path and :help force.com-config-example.
If you want to continue using Ant + ant-salesforce.jar then switch to ant-based branch.

DESCRIPTION

vim-force.com plugin is a bunch of .vim scripts that allow to develop on force.com platform using Vim.

It is designed for those who do not feel productive in Force.com IDE for Eclipse.

General vim-force.com overview - http://www.youtube.com/watch?v=x5zKA6V__co
:ApexRetrieve command demo - http://youtu.be/umO86ji2Iqw
:ApexStage command demo - http://youtu.be/zQg8LORh8uc
Apex Code completion demo - http://youtu.be/u-6JQNuWRdE

Other vim plugins recommended for use alongside vim-force.com plugin

FEATURES

  • Build/Save to SFDC

    • with error reporting
    • "Run test"
      • Execute unit tests in all modified files
      • Execute unit tests in a selected Class
      • Execute selected test method in a selected Class
      • Display code coverage after running test
  • Deploy from one Org to Another

  • Delete selected metadata from SFDC

  • Execute Anonymous

    • whole buffer or selected lines
  • Execute SOQL query

    • supports Partner and Tooling APIs
  • Persistent "Stage" for cherry-picking and re-using list of components to be deployed or deleted

  • Load/update metadata from SFDC

    • Retrieve All or Selected components of given metadata type.
      Support for metadata types that reside inside folders (e.g. Document, Dashboard or Report) is limited because requires querying data (in addition to metadata).
  • Create triggers/classes/pages

  • Refresh project from SFDC

  • Search

    • find word in classes/triggers
    • find word everywhere
    • find visual selection
  • Syntax highlighting

    • supports syntax highlighting of Apex Classes, Triggers, Pages, JS Resources
  • List candidates for auto-completion in Apex classes. Invoked using vim omni-completion: Ctrl-X,Ctrl-O

  • List candidates (field names, object types, relationships, etc) for auto-completion in SOQL expressions. Invoked using vim omni-completion: Ctrl-X,Ctrl-O

  • Most commands (where it makes sense) can be run against different orgs without leaving current project.
    e.g.
    :ApexQuery will run selected SOQL query against the Org configured for current project
    :ApexQuery <api> MyOtherOrg will run the same query against 'MyOtherOrg'.
    Org name supports auto completion.

  • Handling content of zipped .resource files

    • useful when working with rich UIs with lots of javascript and CSS files
  • Basic (really basic) Visualforce code completion

    • try following in .page file
      < Ctrl-X,Ctrl-U
      <apex: Ctrl-X,Ctrl-U
      <chatter Ctrl-X,Ctrl-U
  • Initial support for aura/lightning

    • insert/delete/update/query for all aura file types is fully supported but there is currently no file templates or wizard to create various types of aura files. Use standard vim/file-system tools to create relevant files/folders.

LIMITATIONS

Salesforce.com API does not (in most cases) report error line numbers in Visualforce pages, making it impossible to go-to actual problem line if compile/save fails due to a syntax error.

Apex/SOQL auto-completion is a work in progress and there are many cases when it may not work as expected.

Installation/System requirements

Before vim-force.com plugin can be used the following requirements must be met:

  1. Vim version 7.4 (with job & channel support) or later, with :set nocompatible

  2. Java JDK/JRE, Version 8 or greater

  3. Tooling-force.com
    download jar from 'releases' page

  4. the rest see in vim doc :help force.com-system-requirements or directly in force.com.txt.

RECOMMENDED-PLUGINS

There is a number of great Vim plugins which you may want to consider

  • Fugitive - git support
  • unite.vim or ctrl-p - quick file/buffer open
  • NERDTree - project/file-system browsing
  • Pathogen - manage individually installed plugins in ~/.vim/bundle
  • UltiSnip - implements some of TextMate's snippets features in Vim
  • TagBar - a source code browser plugin for Vim

##CREDITS

Author: Andrey Gavrikov

Credit must go out to Bram Moolenaar and all the Vim developers for making the world's best editor (IMHO). I also want to thank everyone who helped and gave me suggestions. I wouldn't want to leave anyone out so I won't list names.

vim-force.com's People

Contributors

adegregorio avatar breggles avatar deej-io avatar jstvz avatar kgrzywacz avatar neowit avatar niclac avatar nwallace avatar sei40kr avatar thomasdziedzic-pd 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  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  avatar  avatar

vim-force.com's Issues

ApexTest see code coverage for a class

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.

Can't get syntax to show

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?

Refreshing large project causes many copy command prompt windows on Windows

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.

Indentation of visualforce tags doesn't work

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:

  1. Logic that is in place ignores : sign, and everything after, so all apex tags are read as apex instead of i.e. apex:page.
  2. Most of VF tags can be self-closing, which is not really supported by logic in 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?

Deploy All Mode

An "all" mode for apex#MakeProject would be useful, for example, when deploying a project to a new org.

Encoding issue with Anonymous block

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

How to debug "UNKNOWN EXCEPTION" on :ApexDeploy command?

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.

Save / refresh flow

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?

Documentation does not include specification for .property files

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.

Add support for Database.QueryLocator

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\)"

Thank You

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!

No tags for fields with getters/setters

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;
}

ApexDeployAllDestructive fails with missing argument to tooling-force.com

[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

Allow usage of tilde (~) for home directory usage

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?

ApexDeployAll with destructive changes

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.

Creating Custom Objects?

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.

Test Suites

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.

Integrate with TagBar

Tags are shown with TagList but unfortunately not with the alternative TagBar. Some people including me prefer TagBar, so adding support for this would be nice.

Deploy in background via child process? (Neovim feature)

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?

Installation problem

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

Storing of username, password, token

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

ApexLog always says no logs available

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.

Apex Code Completion

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,

Enable apex* commands on package.xml file

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.

Lightning Components / Aura

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.

Explicitly Retrieve Components

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.

A doubt regarding vim command line

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 ?

ApexTest Not Working

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?

ApexRefreshProject and ApexRetrieve fail

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?

Cannot find ApexRefreshFile Command

I cannot find :ApexRefreshFile command from command list, but I can find :ApexRreshProject command. How can I config vim to show :ApexRefreshFile ?

Recommended process to deploy unpacked Static Resource contents

I'm trying to figure out the workflow of editing and deploying the contents of a static resource. The zipped-resources doc says:

  1. Open a *.resource file
  2. Choose a file inside the resource's unpacked directory
  3. Deploy *.resource file using the ApexDeploy command

I 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.

Emulate force.com IDE's "This file has been modified on the server"

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.

Question - save (not deploy) to another org

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

Visualforce highlighting

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:
image
Edit: Actually, first example from above screenshot is invalid, as component name must begin with letter.

Kamil

Some questions / suggestions

Hi @neowit ,

  1. 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.

  2. 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.

  3. 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.

Working with proxy settings and tooling-force.com

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"

Input line is too long issue

Actually, it was the question of how to run the plugin under windows OS. I tried, but failed, always got input line is too long error.

Please check my attachments, I was trying to run the command 'ApexDeploy'

the input line is too long
log

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.