joeferraro / MavensMate-SublimeText

Sublime Text plugin for Salesforce developers. Aims to replace the Eclipse-based Force.com IDE.
http://mavensmate.com
GNU General Public License v3.0
290 stars 119 forks source link

Not reading mm_workspace from user settings #191

Closed capeterson closed 11 years ago

capeterson commented 11 years ago

I have mm_workspace set in my user settings for mavensmate, and on trying to save receive the error "[OPERATION FAILED]:Please set mm_workspace to the location where you'd like your mavensmate projects to reside".

When I set mm_workspace in the default file things get back to normal, but this needs to be redone on every upgrade.

Mavensmate 0.35.1 Sublime text plugin v3.0.4 Sublime text 3, build 3047

joeferraro commented 11 years ago

that's very odd behavior and one I cannot reproduce. let me dig into this a bit more. thanks for the heads up and apologies for the annoyance

capeterson commented 11 years ago

Not a major issue since updates aren't a daily occurance, but I did want to report it. Any logs or the like I can gather that might help reproduce?

steals commented 11 years ago

I have the same behaviour.

Mavensmate app v0.35.1 Sublime Text 3, build 3047 Sublime Text plugin v3.0.5

Tried to restart Sublime after the user setting was changed, but it didn't help.

capeterson commented 11 years ago

Found the issue: I had a trailing comma in my user config file, which made it not valid JSON. I'm not familiar enough with the internals of sublime to know if this is something mavensmate can handle, but if it can I'd ask for a better error message if the user JSON isn't valid. Otherwise feel free to close.

joeferraro commented 11 years ago

definitely an issue, we'll address in the next release

mikebranski commented 9 years ago

For the record, this is still an issue. Removing the trailing comma in my mavensmate.sublime-settings works.

IIRC, SublimeText handles trailing commas in your settings file fine - it's just MavensMate that's having trouble.

fazle-abbas commented 9 years ago

I still am facing the same issue which @capeterson mentioned in description.

Sublime text 3 portable - Build 3083 MM version 4.0.5

Any suggestions @joeferraro ?

capeterson commented 9 years ago

@fazle-abbas try validating your config on something like http://jsonformatter.curiousconcept.com/. If mavensmate fails to parse your config it acts like it doesn't exist (or at least did when I had the issue)

fazle-abbas commented 9 years ago

@capeterson thanks for the pointer. I have checked my config against json formatter and it is correct json. Same config is working on other machine.

joeferraro commented 9 years ago

Please paste your user settings file

On Jul 7, 2015, at 2:17 AM, fazle-abbas notifications@github.com wrote:

@capeterson thanks for the pointer. I have checked my config against json formatter and it is correct json. Same config is working on other machine.

— Reply to this email directly or view it on GitHub.

fazle-abbas commented 9 years ago

Here @joeferraro. Thanks for reaching out man.

/* 
MavensMate settings
NOTE: MavensMate user settings will override MavensMate default settings
To override default MavensMate settings, modify user-specific settings (MavensMate --> Settings --> User) 
** Most changes require a SublimeText restart **
*/

{
    //set to absolute location where you wish your MavensMate project to reside
    //if the location does not exist, MavensMate will attempt to create it
    //for example: "/Users/username/Documents/workspaces/mavensmate" (notice the absolute path)
    //WINDOWS USERS: it's probably best to set this like so: C:\\path\\to\\your\\workspace
    //****NEW****: you can now set mm_workspace to an array of locations on your file system
    //EXAMPLE:
    // "mm_workspace" : [
    //      "/my/workspace",
    //      "/my/other/workspace",
    //      "/my/super/secret/workspace"
    // ]
    "mm_workspace" : "D:\\Sub_Workspace",
            //"D:\\RC - Projects",

    //set if you're behind a proxy (you can also set via export HTTP_PROXY, export HTTPS_PROXY)
    //----IMPORTANT: you MUST escape the 2 slashes after http: and https: as shown below (dont ask, it's a dumb JSON-with-comments parsing issue)
    //examples: 
    //  "mm_http_proxy"  : "http:\/\/10.10.1.10:3128",
    //  "mm_https_proxy" : "http:\/\/10.10.1.10:1080"
    //
    // HTTP Basic Auth
    //  "mm_http_proxy"  : "http:\/\/user:pass@10.10.1.10:3128/",
    //  "mm_https_proxy" : "http:\/\/user:pass@10.10.1.10:1080/"

    "mm_http_proxy" : "",

    "mm_https_proxy" : "",

    //set to desired Salesforce.com API version (tooling api functionality requires 27.0+)
    "mm_api_version" : "31.0",

    //generate from https://mavensmate.herokuapp.com. used to capture high-level usage statistics for community functionality like collaboration, gamification
    "mm_community_api_token" : "",

    //if true, MavensMate will automatically hide the debug panel upon a successful operation
    "mm_hide_panel_on_success" : true,

    //the amount of time (in seconds) before MavensMate hides the debug panel upon a successful operation
    "mm_hide_panel_time" : 0,

    //if true, MavensMate will capture the save file operation and compile to the Salesforce.com server automatically 
    "mm_compile_on_save" : true,

    //if false, mavensmate will store/retrieve sensitive data like passwords in a less secure way
    //set to false only if having issues specifically with keyring or gnome-keyring
    "mm_use_keyring" : true,

    //if true, MavensMate will check for server conflicts and present a server diff when it finds a conflict
    "mm_compile_check_conflicts": true,

    //if true, MavensMate will present local/server diff view when conflict is found for the purposes of merging changes (beta)
    "mm_diff_server_conflicts": true,

    //if true, MavensMate will scroll to the line of a reported exception when there is a compilation error
    "mm_compile_scroll_to_error": true,

    //if true, MavensMate will rollback compiles when an error is encountered
    "mm_compile_rollback_on_error": true,

    //if true, MavensMate will hook into the Sublime Text completions API to offer code assistance
    "mm_autocomplete" : true,

    //if true, MavensMate will check for updates to the mm executable when Sublime Text starts
    "mm_check_for_updates" : true,

    //if true, MavensMate will look for and download pre-releases (beta versions) of the MavensMate API, mm
    "mm_beta_user" : false,

    //if true, MavensMate will automatically install updates to the MavensMate API, mm
    "mm_auto_install_mm_updates" : true,

    //possible values: CRITICAL, ERROR, WARNING, DEBUG, INFO
    "mm_log_level" : "INFO",

    //location where mm debug log should be placed (must be existing path)
    //windows users: please set like so: C:\\path\\to\\your\\logs
    "mm_log_location" : "",

    //if true, mavensmate will send usage statistics (NEVER sensitive information like usernames/passwords/etc) for development, reporting, & debugging purposes (see util.py for source of the call)
    "mm_send_usage_statistics" : true,

    //the path of the mm command line tool
    //"default" means the mm directory is a top-level directory in the package root (MavensMate/mm)
    //if you want MavensMate for Sublime Text to point to a different mm install, please set its path here (some/other/directory/mm)
    "mm_path" : "default",

    //if true, mavensmate will open UIs in default browser
    //linux/windows users: mavensmate UIs are static HTML files, so ensure your browser is set up to open .HTML files by default
    "mm_use_browser_as_ui" : false, 

    //(advanced users only) set to true if you want to use python 2.7 to run mm.py (mm_python_location and mm_py_location must be set)
    "mm_developer_mode" : false,

    //set to location of your python 2.7 install (mm_developer_mode must be set to true)
    "mm_python_location" : "/usr/bin/python",

    //if you wish to run mm via python, you must set this to the location of your mm.py file
    "mm_mm_py_location" : "/path/to/mm.py",

    //linux users: the location of your "subl" executable
    "mm_subl_location" : "/usr/bin/subl",

    //windows users: set to the location of your sublime_text.exe
    "mm_windows_subl_location" : 
                                 // this is also not working
                                 //"C:/Users/Fazle Abbas/AppData/Roaming/Sublime Text 3",

                                 // this is working
                                  "D://SOFTS//Sublime 3//sublime_text.exe", 

                                 // this was default 
                                 // "C:/Program Files/Sublime Text 3/sublime_text.exe",

    //specify a path for custom wsdl files here. wsdls must be named: apex.xml, partner.xml, metadata.xml, tooling.xml
    "mm_wsdl_path" : "",

    //OSX only: the location of your Sublime Text install
    "mm_plugin_client_location" : "/Applications",

    //OSX only: the name of your plugin client app (Sublime Text.app, Sublime Text 3.app, etc.)
    "mm_osx_plugin_client_app_name" : "Sublime Text 3.app",

    //set to true to use the tooling api to compile apex metadata (if you're experiencing any compile issues, set this to false to use the metadata api)
    "mm_compile_with_tooling_api" : true,

    //set to true if you want a history of your executed apex scripts in project/apex-scripts
    "mm_log_anonymous_apex" : true,

    //local server port
    "mm_server_port" : 7777,

    //mavensmate will attempt to compile when savings files with the following extensions
    "mm_apex_file_extensions": [
        ".page",
        ".component",
        ".cls",
        ".object",
        ".trigger",
        ".layout",
        ".resource",
        ".remoteSite",
        ".labels", 
        ".app",
        ".dashboard",
        ".permissionset",
        ".workflow",
        ".email",
        ".profile",
        ".scf",
        ".queue",
        ".reportType",
        ".report",
        ".weblink",
        ".tab",
        ".letter",
        ".role",
        ".homePageComponent",
        ".homePageLayout",
        ".objectTranslation",
        ".flow",
        ".datacategorygroup",
        ".snapshot",
        ".site",
        ".sharingRules",
        ".settings",
        ".callCenter",
        ".community",
        ".authProvider",
        ".customApplicationComponent",
        ".quickAction",
        ".approvalProcess",
        ".html",
        ".apxc",
        ".apxt"
    ],

    //template location, e.g. "remote" or "local" ("remote" refers to templates located on github)
    "mm_template_location": "remote",

    //template location 
    //if "mm_template_location" is set to "local", set to absolute location of the directory where you've forked the MavensMate-Templates project
        //example: "mm_template_source" : "/path/to/templates"
    //if "mm_template_location" is set to "remote", set to github location)
        //example: "mm_template_source" : "username/reponame/branchname"
    //project directory/repository must be in the format found here: https://github.com/joeferraro/MavensMate-Templates
    "mm_template_source": "joeferraro/MavensMate-Templates/master",

    //the default metadata available in a project (may be set on a per-project basis in the "advanced" tab of the new and edit project UIs)
    "mm_default_subscription" : [
        "ApexClass",
        "ApexComponent",
        "ApexPage",
        "ApexTrigger",
        "StaticResource",
        "CustomObject",
        "Profile"
    ],

    //ignore metadata from managed packages (highly recommended)
    "mm_ignore_managed_metadata" : true,

    //the number of the most recent apex debug logs to download during the "fetch logs" command
    "mm_number_of_logs_limit" : 10,

    //choices: "metadata" or "apex". "metadata" is recommended, however if your tests are taking forever to run, try switching to "apex"
    //we're working on async testing api support in 0.36
    "mm_test_api" : "metadata",

    //if true, mavensmate will store all deployment packages in your project's "deploy" directory
    "mm_archive_deployments" : true,

    //if true, mavensmate will set the purgeOnDelete to true during metadata deletes (a hard delete)
    "mm_purge_on_delete" : false,

    "mm_verbose" : false,

    //set to false if during completions, the size of your .org_metadata file is bogging down the editor during code completion
    "mm_use_org_metadata_for_completions" : true,

    //set to false if index symbol indexing during project creation/upgrade is causing timeouts
    "mm_mass_index_apex_symbols" : false,

    //set to false if you want to use the async apex testing endpoint (beta)
    "mm_use_legacy_test_ui" : true,

    //if true, a log will be generated for every test run during "run all tests" command
    "mm_download_logs_during_run_all_tests" : false,

    //timeout (in seconds) for calls to the Salesforce.com servers
    "mm_timeout" : 10,

    //*BETA* if true, MavensMate will compare the state of the destination org(s) before deployment
    "mm_compare_before_deployment" : true,

    //Advanced users only: if true, MavensMate will not check if your project was created using an older version of MavensMate
    "mm_skip_legacy_check" : false,

    // set true to play notifiation sounds
    "mm_play_sounds" : true,

    // set true to play sounds on MM events (compile successes/failures, file refreshes, code coverage updates etc)
    "mm_play_general_sounds" : true,
    "mm_play_success_sounds" : true,
    "mm_play_failure_sounds" : true,

    // set paths for custom MM event sounds; if empty/absent then the default will be used
    // only .wav files allowed; Windows users should use double backslash for path: \\
    "mm_general_sound_path" : "",
    "mm_success_sound_path" : "",
    "mm_failure_sound_path" : ""
}
joeferraro commented 9 years ago

What happens if you remove all other user settings and just set mm_workspace?

{
"mm_workspace" : "D:\\Sub_Workspace"
}
fazle-abbas commented 9 years ago

@joeferraro - If I keep only mm_workspace then it is not able to find ST. My current settings are

{
"mm_workspace" : "D:\\Sub_Workspace",
"mm_windows_subl_location" : "D://SOFTS//Sublime 3//sublime_text.exe"
}

And it shows the error as -

response from mm: {"body": "Please set mm_workspace to the location where you'd like your mavensmate projects to reside", "stack_trace": "Traceback (most recent call last):\n  File \"C:\\Users\\Administrator\\Desktop\\ghook\\build\\mm\\out00-PYZ.pyz\\mm.request\", line 69, in execute\n  File \"C:\\Users\\Administrator\\Desktop\\ghook\\build\\mm\\out00-PYZ.pyz\\mm.request\", line 60, in __setup_connection\n  File \"C:\\Users\\Administrator\\Desktop\\ghook\\build\\mm\\out00-PYZ.pyz\\mm.connection\", line 47, in __init__\n  File \"C:\\Users\\Administrator\\Desktop\\ghook\\build\\mm\\out00-PYZ.pyz\\mm.connection\", line 151, in get_workspace\nMMException: Please set mm_workspace to the location where you'd like your mavensmate projects to reside\n", "success": false}

This is the same error that I was getting in presence of all other setting values.

joeferraro commented 9 years ago

@fazle-abbas and D:\\Sub_Workspace exists? And you're sure the file you're changing is your USER settings file, correct (not the DEFAULT settings)?

fazle-abbas commented 9 years ago

@joeferraro Yes, that folder exists and I am changing my user settings only on - Sublime text 3 portable - Build 3083 MM version 4.0.5

joeferraro commented 9 years ago

Can you paste the full path of the settings file you're updating?

fazle-abbas commented 9 years ago

D:\SOFTS\Sublime 3\Data\Packages\User and the file name is mavensmate.sublime-settings

joeferraro commented 9 years ago

@fazle-abbas ah, ok, i see the issue. with the portable version of sublime, the settings can be located anywhere on the drive. In its current state, the underlying api, mm can only detect settings in the user's %appdata% directory.

The workaround for now is to put that mavensmate.sublime-settings file in your local system user's AppData directory. Something like: C:/Users/YourUsername/AppData/Sublime Text 3/Packages/User directory (create it if it does not exist)

Let me know if this works for you

fazle-abbas commented 9 years ago

@joeferraro I've created a junction folder in my %APPDATA% directory.

dierdre commented 9 years ago

@joeferraro - I'm getting the same error. I'm on a mac and my mm_workspace is set to user/dkp/Dropbox/Workspace in MM settings as well as Sublime > MavensMate > Settings > User. mavensmate.sublime-settings was already located in ~/Library/Application Support/Sublime Text 3/Packages/User.

From the settings file: "mm_workspace" : [ "users/dkp/Dropbox/Workspace" ],

Please let me know what I am missing. Thank you!

gshaw60 commented 9 years ago

I was faced with the same issue. MavensMate is reporting v6: 'MavensMate for Sublime Text v6.0.0' I edited the ~Library/Application Support/Sublime Text 3/Packages/User/mavensmate.sublime-settings file and added mm_workspace from the mavensmate-deprecated.sublime-settings file. I'm now working again. Hope this helps.