Skip to content

Commit

Permalink
Release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
B. Scott Michel committed Apr 28, 2017
2 parents fecd12f + 580a87c commit db78e22
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 51 deletions.
1 change: 1 addition & 0 deletions Keymaps/Default.sublime-keymap
Expand Up @@ -22,6 +22,7 @@
{ "key": "scanned_source" } ],
"command": "sublime_haskell_go_to_declaration"
},
{ "keys": ["ctrl+b"], "context": [ { "key" : "haskell_source" } ], "command": "sublime_haskell_build" },
{ "keys": ["ctrl+shift+y"], "context": [ { "key": "haskell_source" } ], "command": "sublime_haskell_expand_selection_expression" },
{ "keys": ["ctrl+m", "ctrl+i"], "context": [ { "key": "haskell_source" } ], "command": "sublime_haskell_insert_import" },
{ "keys": ["ctrl+k", "ctrl+h", "ctrl+t"], "context": [ { "key" : "haskell_source" } ], "command": "sublime_haskell_show_type" },
Expand Down
135 changes: 135 additions & 0 deletions Messages/1.2.2.md
@@ -0,0 +1,135 @@
SublimeHaskell 1.2.2
====================

__PLEASE RESTART SublimeText AFTER INSTALLING THIS UPDATE!__

### 1.2.2

- Make the parsed error/warning output window reappear after a build. (Reported by _cartazio_.)

- _Ctrl-B_ invokes `SublimeHaskell: Build`. No more spurious error messages about `runhaskell`. (Updated Mac OS X keymap is in the works so that _Cmd-B_ does the right thing too. Please have some patience.)

- Bump the `hsdev` version number _and_ patch the command line to reflect changes to the `simple-log` package's updated (simplified) command line arguments. __Please read the SublimeHaskell package's default settings if you want or need to adjust the `hsdev` logging level.__

- Add support for the new `cabal` build system (see the _haskell_build_tool_ setting.) The builder's name is `cabal-new-build`. Eventually, this will become `cabal` when the `cabal` maintainers decide their new build system is stable.


### 1.2.1

- Fix `client.py` tracebacks and `hsdev` connection sequencing. Connections are now synchronous, not asynchronous.

### 1.2.0

_SublimeHaskell_ 1.2.0 is a stability release, with a lot of fixes resulting from a `pylint` code audit. While a majority of these "fixes" were Python style-related (line lengths, spaces between keywords and arguments), there were errors (usually bad attribute references to the wrong imported module) and a need to simplify complex logic in a few places (breaking up complex `if`-`elif`-`else` blocks.) The overall McCabe assessment went from 5.75/10 to 9.71/10, a significant improvement.

## `hsdev` 0.2.3.0 and higher

The minimum supported `hsdev` is version 0.2.0.0. There is no upper bound on `hsdev`'s version; the current version (as of this release) is 0.2.3.2.

Changes to the `simple-log` package simplified logging support. However, this simplification is a _breaking change_ to `hsdev` command line arguments.

`hsdev` 0.2.3.0 and higher: Logging is controlled by the `hsdev_log_level` preference. Valid values are _trace_, _debug_, _info_, _warning_, _error_ and _fatal_. This sets the highest level of message that `simple-log` will output, i.e. _fatal_ will only output fatal messages, whereas _debug_ will output debug, info, warning, error and fatal messages.

`hsdev` 0.2.2.9 and lower: Logging is still controlled by the `hsdev_log_config` preference. Eventually, this preferece will disappear when the `hsdev` minimum version is increased to 0.2.3.0.

## SublimeText 2 Support Removed

SublimeText 2 compatibility was tested after the `pylint` code audit. The current code base uses API calls to the SublimeText3 API that aren't present or featured in SublimeText2, and no workarounds exist. Couple that with the complete lack of issues related to SublimeText 2 and it wasn't a hard decision to remove SublimeText 2 compatibility.

SublimeText 2: We loved you. We bid you a fond farewell as you head to your retirement.

## New Feature: Remote `hsdev`

The `hsdev` backend has three new preferences that control _SublimeHaskell_'s interaction with the `hsdev` backend:

| Preference | Description |
| --------------------- |-----------------------------------------------------------------------|
| `hsdev_host` | The host name where the `hsdev` backend is located. |
| | Default: "localhost" |
| `hsdev_port` | The port number to which the `hsdev` backend listens for connections. |
| | Default: 4567 |
| `hsdev_local_process` | Controls whether _SublimeHaskell_ will start up a local `hsdev` backend process or simply connect to the backend via `hsdev_host` and `hsdev_port`. |
| | Default: true (`hsdev` backend process started by _SublimeHaskell_) |

Add and customize the folowing SublimeHaskell_ "Settings - User" preferences if you have a remote `hsdev` backend that you want to use instead of having _SublimeHaskell_ start up its own `hsdev`:

```yaml
{
// Remote hsdev is on the "my_hsdev_host.domain.net" machine
"hsdev_host": "my_hsdev_host.domain.net",
// Remote hsdev listens to port 4096 for connections (default: 4567)
"hsdev_port": 4096,
// SublimeHaskell will not start or manage its own hsdev backend process
"hsdev_local_process": false,

// Other preferences follow...
}
```

## Next/Previous Error

These commands now work as intended. "Goto next error" didn't; it would get stuck at the first error.

The _<alt>-D <alt>-E_ key mapping for "next error" and _<shift>-<alt>-D <shift>-<alt>-E_ mapping for "previous error" can be a bit awkward. This key mapping was borrowed from the (now defunct) SublimeClang plugin. If you prefer _<ctrl>-K n_ and _<ctrl>-K p_ that SublimeLinter uses, add these two lines to your "Key Bindings" preferences:

```
{ "keys": ["ctrl+k", "n"], "context": [ { "key": "haskell_source" } ], "command": "sublime_haskell_next_error" },
{ "keys": ["ctrl+k", "p"], "context": [ { "key": "haskell_source" } ], "command": "sublime_haskell_previous_error" },
```

## In Case You Missed It...

### Environment variables in `add_to_PATH`

You may have missed this in an earlier release: You can use environment variables in the `add_to_PATH` setting. Both Unix-style (`$HOME`) and Windows-style (`%APPDATA%`) are supported. Tilde-expansion (`~/.local/bin`) also works.

### `add_standard_dirs` Setting

_SublimeHaskell_ will add several "standard" directories to its `PATH` when searching for tools. This eliminates the need to modify the `add_to_PATH` setting if you installed `hsdev` or `ghc-mod` in one of the "standard" Haskell places. `add_standard_dirs` defaults to `true`.

Excerpt from the default setings:

```yaml
// Add the "standard" directories where cabal and stack install executables,
// if they exist, in the following order (top to bottom):
//
// stack's install dir
// user bindir from $HOME/.cabal/config (*nix) or %APPDATA%/cabal/config (WinXX)
// global bindir from $HOME/.cabal/config (*nix) or %APPDATA%/cabal/config (WinXX)
//
// The defaults are:
//
// stack: {$HOME/.local|%APPDATA%/local}/bin
// user: {$HOME/.cabal|%APPDATA%/cabal}/bin
// global: {/usr/local|%PROGRAMFILES%/Haskell}/bin
"add_standard_dirs": true,
```

Basically, this should make it easier to use _SublimeHaskell_ out-of-the-box.

## Upcoming Development Milestones

Upcoming development milestones, listed in order of priority:

### Backend Refactoring (Expected: 1.4.0)

Work is in progress to refactor _SublimeHaskell_'s interaction with the three backends: `hsdev`, `ghc-mod` and `hdevtools`. Support for `hdevtools` may be dropped completely -- if `hdevtools` is important to you, please file an issue. The rationale for this refactoring is to make the interface cleaner between the plugin and the backend so that it's clear what features the backend supports and provide a reasonable default action for unsupported features. This will also enable enterprising Haskell backend developers to easily add new backends to _SublimeHaskell_ (e.g., `intero` support has come up a few times as an enhancement request.)

__Note__: The refactored backend will introduce __BREAKING CHANGES__ to the default and user settings.

### Lazy Backend Startup (Expected: 1.4.0)

Related to backend refactoring is lazy backend startup: _SublimeHaskell_ should start up and connect to a backend only when it's needed. Currently, _SublimeHaskell_ is too eager and starts up the `hsdev` backend when the plugin is loaded. This enhancement will make _SublimeHaskell_ lazier or, at least, less eager.

### Switching between multiple `stack.yaml`-s (Expected: 1.3.0)

For `stack` tool users, it will be possible to specify a list of `stack.yaml` files in your project settings and switch between them. When you switch, _SublimeHaskell_ will execute a rebuild (`clean` followed by `build`).

### The SublimeHaskell Editing Guide (Ongoing)

Documentation is always a good thing. The guide is a work-in-progress.

### SublimeText 3 Syntax Files (Expected: 1.5.0)

There are numerous issues related to syntax highlighting. Syntax highlighting in SublimeText 2 was driven by collections of regular expressions. SublimeText 3 syntax highlighting still uses regexps and offers the ability to be more stateful. However, transitioning from _SublimeHaskell_'s improved ST2 syntax highlighting to ST3 syntax highlighting requires substantial work.
24 changes: 19 additions & 5 deletions Settings/SublimeHaskell.sublime-settings
Expand Up @@ -8,8 +8,14 @@
// Enable auto build project on save
"enable_auto_build": false,

// Haskell build tool: "cabal" to use only cabal and "stack" to use stack whenever
// there's stack.yaml in project root
// Haskell build system. Choices are:
//
// "cabal": Use cabal to build projects
// "cabal-new-build": Use the new cabal build system
// "stack" Use stack to build projects
//
// Ideally, you should put your default preference in your User preferences. Someday, SublimeHaskell
// will pick this up on a per-project basis.
"haskell_build_tool": "stack",

// Enable auto run tests on save, has effect only if auto build enabled (enable_auto_build)
Expand Down Expand Up @@ -155,7 +161,15 @@
// Log level, 0 — no log, 1 — errors, 2 — warnings, 3 — info messages, 4 — debug, 5 — trace
"log": 1,

// hsdev's logging: 'use default' (somewhat verbose, informational), 'use silent' (quiet)
// This is a somewhat magic setting that comes from the Haskell 'simple-log' documentation.
"hsdev_log_config": "use silent"
// hsdev logging output:
//
// !!!PAY ATTENTION TO YOUR HSDEV VERSION!!!
//
// hsdev version 0.2.2.0 and below: The "hsdev_log_config" preference controls hsdev's logging. It has several interesting
// values: 'use default' (somewhat verbose, informational), 'use silent' (quiet)
//
// hsdev version 0.2.3.0 and higher: The "hsdev_log_level" preference controls hsdev's logging. Valid values are
// 'trace', 'debug', 'info', 'warning', 'error' and 'fatal'.
"hsdev_log_config": "use silent",
"hsdev_log_level": "warning"
}
45 changes: 32 additions & 13 deletions build.py
Expand Up @@ -18,12 +18,17 @@

BUILD_TOOL = {
'cabal': {'command': 'cabal', 'name': 'cabal'},
'cabal-new-build': {'command': 'cabal', 'name': 'cabal (new build)'},
'stack': {'command': 'stack', 'name': 'stack'}
}


def same_steps(steps):
return {'cabal': steps, 'stack': steps}
return {
'cabal': steps,
'cabal-new-build': steps,
'stack': steps
}

BUILD_TOOL_CONFIG = {
'clean': {
Expand All @@ -33,48 +38,62 @@ def same_steps(steps):
'configure': {
'message': 'Configuring',
'steps': {
'cabal': [['configure', '--enable-tests']],
'stack': []
'cabal': [['configure', '--enable-tests']],
'cabal-new-build': [['new-configure', '--enable-tests']],
'stack': []
}
},
'build': {
'message': 'Building',
'steps': same_steps([['build']])
'steps': {
'cabal': [['build']],
'cabal-new-build': [['new-build']],
'stack': [['build']]
}
},
'typecheck': {
'message': 'Checking',
'steps': same_steps([['build', '--ghc-options=-c']])
'steps': {
'cabal': [['build', '--ghc-options=-c']],
'cabal-new-build': [['new-build', '--ghc-options=-c']],
'stack': [['build', '--ghc-options=-c']]
}
},
# Commands with warnings:
# Run fast, incremental build first. Then build everything with -Wall and -fno-code
# If the incremental build fails, the second step is not executed.
'build_then_warnings': {
'message': 'Building',
'steps': {
'cabal': [['build'], ['build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'stack': [['build']]
'cabal': [['build'], ['build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'cabal-new-build': [['new-build'], ['new-build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'stack': [['build']]
}
},
'typecheck_then_warnings': {
'message': 'Checking',
'steps': {
'cabal': [['build', '--ghc-options=-c'], ['build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'stack': [['build']]
'cabal': [['build', '--ghc-options=-c'], ['build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'cabal-new-build': [['new-build', '--ghc-options=-c'],
['new-build', '-v0', '--ghc-options=-fforce-recomp -fno-code']],
'stack': [['build']]
}
},

'rebuild': {
'message': 'Rebuilding',
'steps': {
'cabal': [['clean'], ['configure', '--enable-tests'], ['build']],
'stack': [['clean'], ['build']]
'cabal': [['clean'], ['configure', '--enable-tests'], ['build']],
'cabal-new-build': [['clean'], ['new-configure', '--enable-tests'], ['new-build']],
'stack': [['clean'], ['build']]
}
},
'install': {
'message': 'Installing',
'steps': {
'cabal': [['install', '--enable-tests']],
'stack': [['install']]
'cabal': [['install', '--enable-tests']],
'cabal-new-build': [['install', '--enable-tests']],
'stack': [['install']]
}
},
'test': {
Expand Down

0 comments on commit db78e22

Please sign in to comment.