Skip to content

Commit

Permalink
fix #130 (#138)
Browse files Browse the repository at this point in the history
* Move core files to 'core' directory.
Remove Nimsuggest and Nimble support.

* Refactor settings, hotkeys, and nimcheck code.

* Fix #110

* Fix file permissions.

* fix #118 (#120)

* fix #118

* Update core/commands/nimcheck.py

Co-Authored-By: timotheecour <[email protected]>

* Make command import more correct.

* fix #112 (#123)

* Split comment grammer into separate file, to support nested multiline comments.
Fixes #94

* Update keymaps for new comment definitions.
Fixes #94, #97, and #128

* Straighten out TODO matching.

* Simplify package settings menu by using native edit_settings command.

* Fix comment continuation.

* Remove ST2/ST3 distinction.

* comment and doc comment completion work (#133)

* fix #134 (#135)

* fix #125 (#127)

* should fix #125 (hopefully)
let me know if I'm mistaken

* Update Nim.YAML-tmLanguage (#126)
  • Loading branch information
timotheecour authored and Varriount committed Dec 29, 2018
1 parent e63f5bf commit f75325a
Show file tree
Hide file tree
Showing 43 changed files with 1,028 additions and 4,010 deletions.
5 changes: 3 additions & 2 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "selection_empty", "operand": true },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" }
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.body.nim" }
]
},
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n## $0"}, "context":
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "setting.doccontinue.autostop", "operand": false },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.empty.nim"}
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" },
{ "key": "selector", "operand": "punctuation.definition.doc-comment.nim", "operator": "not_equal" }
]
},

Expand Down
13 changes: 10 additions & 3 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,30 @@
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "selection_empty", "operand": true },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" }
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.body.nim" }
]
},
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n## $0"}, "context":
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "setting.doccontinue.autostop", "operand": false },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.empty.nim"}
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" },
{ "key": "selector", "operand": "punctuation.definition.doc-comment.nim", "operator": "not_equal" }
]
},

// Multi-line doc-comment completion
// Multi-line comment completion
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[\n$0\n]#"}, "context":
[
{ "key": "selector", "operator":"equal", "operand": "punctuation.definition.comment.nim"}
]
},
// Multi-line doc-comment completion
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[\n$0\n]##"}, "context":
[
{ "key": "selector", "operator":"equal", "operand": "punctuation.definition.doc-comment.nim"}
]
},

// Pragma completion
{ "keys": ["."], "command": "insert_snippet", "args": {"contents": ".$0."}, "context":
Expand Down
5 changes: 3 additions & 2 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "selection_empty", "operand": true },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" }
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.body.nim" }
]
},
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n## $0"}, "context":
[
{ "key": "setting.doccontinue.enabled", "operand": true },
{ "key": "setting.doccontinue.autostop", "operand": false },
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.empty.nim"}
{ "key": "selector", "operand": "comment.line.number-sign.doc-comment.nim" },
{ "key": "selector", "operand": "punctuation.definition.doc-comment.nim", "operator": "not_equal" }
]
},

Expand Down
4 changes: 0 additions & 4 deletions Nim.sublime-settings

This file was deleted.

11 changes: 1 addition & 10 deletions NimLime.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
# coding=utf-8
"""
Stub file for loading the NimLime plugin.
See __init__.py for the actual code.
"""
import os
import sys

root_dir = os.path.dirname(os.path.abspath(__file__))
if sys.version_info < (3, 0):
execfile('__init__.py')
from NimLime.core.commands import *
98 changes: 7 additions & 91 deletions NimLime.sublime-settings
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
// Misc. Settings //
"nim.executable": "nim",
// Executable paths.
// These *must* be in absolute form, or the name of the executable
// (if it's in the PATH environment variable)
"nimble.executable": "nimble",
"nimsuggest.executable": "nimsuggest",
"nim.executable": "nim",
"error_handler.enabled": true,
"error_handler.logpath": "",
"error_handler.logfile_path": "",

"translate_tabs_to_spaces": true,
"enable_nim_completions": true,
"provide_immediate_nim_completions": false,
"auto_complete_triggers": [ {"selector": "source.nim", "characters": "."} ],

// Below are settings for various commands and features.
//
Expand All @@ -23,7 +18,7 @@
// 'output.send':
// Toggles sending output to an output view.
//
// 'output.clear':
// ' output.clear':
// Toggles clearing previous output when writing the command's output
// to the output view. Has no effect when 'output.send' is false.
//
Expand Down Expand Up @@ -69,72 +64,6 @@
"doccontinue.autostop": true,


//// Nimble Interface Settings ////
// Unique settings suffixes:
// 'preemptive_search':
// Perform an initial search using user input. May reduce memory/cpu
// usage when searching via the quickpanel, as not all results are
// loaded.

// Settings for the 'nimble update' command
"nimble.update.enabled": false,

"nimble.update.output.send": false,
"nimble.update.output.show": false,
"nimble.update.output.clear": false,
"nimble.update.output.name": "Nimble Update Output",
"nimble.update.output.method": "grouped",
"nimble.update.output.tag": "nimble",
"nimble.update.output.raw": false,

// Settings for the 'nimble list' command
"nimble.list.enabled": true,
"nimble.list.quickpanel.send": true,

"nimble.list.output.send": false,
"nimble.list.output.show": false,
"nimble.list.output.clear": false,
"nimble.list.output.name": "Nimble List Output",
"nimble.list.output.method": "grouped",
"nimble.list.output.tag": "nimble",
"nimble.list.output.raw": false,

// Settings for the 'nimble search' command
"nimble.search.enabled": true,
"nimble.search.quickpanel.send": true,

"nimble.search.output.send": false,
"nimble.search.output.show": false,
"nimble.search.output.clear": false,
"nimble.search.output.name": "Nimble Search Output",
"nimble.search.output.method": "grouped",
"nimble.search.output.tag": "nimble",
"nimble.search.output.raw": false,

// Settings for the 'nimble install' command
"nimble.install.enabled": true,
"nimble.install.preemptive_search": false,

"nimble.install.output.send": false,
"nimble.install.output.show": false,
"nimble.install.output.clear": false,
"nimble.install.output.name": "Nimble Install Output",
"nimble.install.output.method": "grouped",
"nimble.install.output.tag": "nimble",
"nimble.install.output.raw": false,

// Settings for the 'nimble uninstall' command
"nimble.uninstall.enabled": true,

"nimble.uninstall.output.send": false,
"nimble.uninstall.output.show": false,
"nimble.uninstall.output.clear": false,
"nimble.uninstall.output.name": "Nimble Uninstall Output",
"nimble.uninstall.output.method": "grouped",
"nimble.uninstall.output.tag": "nimble",
"nimble.uninstall.output.raw": false,


//// Nim Check Settings ////
// Unique settings suffixes:
// 'highlight_errors':
Expand Down Expand Up @@ -173,9 +102,7 @@

"check.on_save.output.send": false,
"check.on_save.output.show": false,
"check.on_save.output.name": "Nim Check - Current File",
"check.on_save.output.method": "grouped",
"check.on_save.output.clear": false,
// "check.on_save.output.clear": false,
"check.on_save.output.tag": "Nim Check",
"check.on_save.output.raw": false,

Expand All @@ -193,9 +120,7 @@

"check.current_file.output.send": false,
"check.current_file.output.show": false,
"check.current_file.output.clear": false,
"check.current_file.output.name": "Nim Check - Current File",
"check.current_file.output.method": "grouped",
// "check.current_file.output.clear": false,
"check.current_file.output.tag": "Nim Check",
"check.current_file.output.raw": false,

Expand All @@ -205,19 +130,10 @@

"check.external_file.output.send": true,
"check.external_file.output.show": true,
"check.external_file.output.clear": true,
"check.external_file.output.name": "Nim Check - External File",
"check.external_file.output.method": "grouped",
"check.external_file.output.include_context": true,
// "check.external_file.output.clear": true,
"check.external_file.output.tag": "Nim Check",
"check.external_file.output.raw": false,

// Settings for the 'clear errors' command
"check.clear_errors.enabled": true,

// IDE Tool Settings //
"idetools.find_definition.enabled": true,
"idetools.find_usages.enabled": true,
"idetools.find_current_file_usages.enabled": true,
"idetools.get_suggestions.enabled": true
"check.clear_errors.enabled": true
}
82 changes: 11 additions & 71 deletions Support/Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
[
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children":
[
Expand All @@ -16,85 +12,29 @@
"children":
[
{
"caption": "NimLime",
"id": "nimlime",
"children":
[
{
"command": "nim_lime_open_support",
"caption": "Support/Issue Tracker"
}
]
},

{ "caption": "-" },

{
"command": "open_file", "args":
{
"file": "${packages}/NimLime/NimLime.sublime-settings"
},
"caption": "Settings – Default"
},
{
"command": "open_file", "args":
{
"file": "${packages}/User/NimLime.sublime-settings"
},
"caption": "Settings – User"
"command": "nim_lime_open_support",
"caption": "Support/Issue Tracker"
},

{ "caption": "-" },


{
"command": "open_file", "args":
"command": "edit_settings", "args":
{
"file": "${packages}/NimLime/Default (OSX).sublime-keymap",
"platform": "OSX"
"base_file": "${packages}/NimLime/NimLime.sublime-settings",
"default": "{\n\t$0\n}\n"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file", "args":
{
"file": "${packages}/NimLime/Default (Linux).sublime-keymap",
"platform": "Linux"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/NimLime/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – Default"
"caption": "Settings"
},

{
"command": "open_file", "args":
{
"file": "${packages}/User/Default (OSX).sublime-keymap",
"platform": "OSX"
},
"caption": "Key Bindings – User"
},
{
"command": "open_file", "args":
"command": "edit_settings", "args":
{
"file": "${packages}/User/Default (Linux).sublime-keymap",
"platform": "Linux"
},
"caption": "Key Bindings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/User/Default (Windows).sublime-keymap",
"platform": "Windows"
"base_file": "${packages}/NimLime/Default ($platform).sublime-keymap",
// TODO: is this correct? not sure when / how this is used
"default": "{\n\t$0\n}\n"
},
"caption": "Key Bindings – User"
"caption": "Key Bindings"
}
]
}
Expand Down
Loading

0 comments on commit f75325a

Please sign in to comment.