Giter Site home page Giter Site logo

vim-hack's People

Contributors

fabiomcosta avatar fredemmott avatar int3 avatar iwonbigbro avatar jpalazz2 avatar jwatzman avatar luizribeiro avatar mxw avatar ryanplasma avatar usox avatar wilfred avatar yiding avatar yifuwang avatar zefei avatar zhyty 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-hack's Issues

Run on OS X?

Hey there,

I recently built hh_client/hh_server on OS X and they seem to be working (though I'll be giving them a bit of a stress test over the coming days).

One thing I'd love would be being able to use vim-hack with them on OS X.

I'm running a fresh install of MacVim + VimBox[0], but after cloning the repository into ~/.vim/bundles/ and opening and saving a Hack file, it doesn't appear to be working.

Has anyone else got it running? Is it an incompatibility with VimBox/MacVim? Is it not picking up my symlinks (in /usr/local/bin/)?

Cheers!

I don't seem to get the omnifunc to work

I contstantly get: -- Omni completion (^O^N^P) Pattern not found
after I do Ctrl+x Ctrl+o

Part from my .vimrc

Bundle 'hhvm/vim-hack'
let g:hack#autoclose = 1
let g:hack#enable=1

filetype plugin on
set omnifunc=hackcomplete#Complete

Do I overlook something?

Migrate to use the LSP

Ideally use hh_client --version --json and use legacy approach if api_version < 5.

The neovim LanguageClient plugin also works happily on vim 8 - I'm using it with MacOS High Sierra's default vim with fredemmott/dotfiles@55054f2

In that setup, I'm basically just using this plugin for syntax highlighting, LSP for everything else.

E118: Too many arguments for function: <SNR>24_JobExitHandler

When running :HackMake on file I get E118: Too many arguments for function: <SNR>24_JobExitHandler. Is there a way to debug this..
I'm running Neovim on Mac OS Sierra 10.12.5

NVIM v0.2.1-40-g4c3d7b29
Build type: RelWithDebInfo
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170508-5291-1ymt129/build/config -I/tmp/neovim-20170508-5291-1ymt129/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim-20170508-5291-1ymt129/build/src/nvim/auto -I/tmp/neovim-20170508-5291-1ymt129/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-4c3d7b2/share/nvim"

I removed a bunch of plugins in hopes to fix.

call plug#begin('~/.config/nvim/plugged')

"Git integration
Plug 'tpope/vim-fugitive'
"Plug 'leafgarland/typescript-vim'
"Plug 'Valloric/YouCompleteMe'
"Plug 'ryanoasis/vim-devicons'
Plug 'Shougo/deoplete.nvim'
Plug 'vim-airline/vim-airline'
"Ranger - Filesystem browsing
"Plug 'francoiscabrol/ranger.vim'
"Plug 'rbgrouleff/bclose.vim'

"VueJS support
"Plug 'posva/vim-vue'
"Plug 'joonty/vdebug'

Plug 'gioele/vim-autoswap'

"jsx
"Plug 'pangloss/vim-javascript'
"Plug 'mxw/vim-jsx'
"Hack
Plug 'hhvm/vim-hack'

"emmet
"Plug 'mattn/emmet-vim'

"AutoFormat
Plug 'Chiel92/vim-autoformat'
"For Searching Stuff
Plug 'rking/ag.vim'
"CtrlP for searching files
Plug 'ctrlpvim/ctrlp.vim'
"Plug 'tobyS/pdv'
"Plug 'tobyS/vmustache'
"Plug 'SirVer/ultisnips'

"Golang Integration
"Plug 'fatih/vim-go'
"Plug 'zchee/nvim-go', { 'do': 'make'}
"NerdTree
Plug 'scrooloose/nerdTree'
Plug 'Xuyuanp/nerdtree-git-plugin'
"Tagbar
Plug 'majutsushi/tagbar'
"Dash integration
Plug 'rizzatti/dash.vim'
"Theme
"Plug 'jacoborus/tender.vim'
"Plug 'mhartington/oceanic-next'
"Neomake
"Plug 'neomake/neomake'
"Plug 'mustache/vim-mustache-handlebars'
call plug#end()

indentation not working if filetype=hack

Steps to reproduce:

  • create new file "test.hack"
  • add the following content
function test() {
$a = 1;
}

Action: gg=G to indent whole file

Expected Result: file should be indented properly

function test() {
    $a = 1;
}

Actual:

function test() {
$a = 1;
}

However it works if we place the function in a php file like

<hh
function test() {
$a = 1;
}

I see that indent expression for hack is GetHackIndent, which uses GetPhpIndent under the hood. However, according to :h php-indent, php indenting only works if PHP syntax is active. Maybe it's time to create an index expression dedicated to Hack?

Unbound name: ReflectionClass

When using ReflectionClass inside of a Hack class I am getting the following error in vim:

example.php|6 col 18 error|   Unbound name: ReflectionClass

The code in question:

<?hh // strict
class Foo {
  public function bar(string $baz) : void
  {
    if (class_exists($baz)) {
      $foo = new \ReflectionClass($baz);
    }
  }
}

Error at startup

I get this error after installing the plugin with Vundle:

no such highlight group name: phpInterfaces

Any ideas what the issue could be?

Type errors in other files

Hello! First off, this is awesome, like wow. What I was wondering was if it is expected that, if we change a type for, say, a function in one buffer, that we should not see that this causes errors in other files where that function is called.

For example:

# foo.php
<?hh // strict

function add(int $a, $int b): int{ ... }
# bar.php
<?hh

$val = add("a", "b");

In the above scenario, if I have bar.php open in another buffer, I can see the error perfectly. But if add() is called elsewhere in the codebase (or I happen to not have that file open), the only way to find out where this causes problems is by manually running hh_client, right? It's not expected to see the error in bar.php from the foo.php buffer?

Syntax colouring not working on shell executable scripts

When writing scripts that should be called from within the shell, the syntax colouring feature of the vim-hack plugin get's broken. This is probably due to the fact that such scripts need to have the following as their first line

#!/usr/bin/hhvm

So an example of this would be a hypothetical script called version with the following lines:

#!/usr/bin/hhvm
<?hh

function printVersion(string $version) {
    echo "Version: $version\n";
}

printVersion("1.0");

When opening this script inside vim, the vim-hack plugin colours it very differently from normal hack files, only highlighting strings and leaving everything else uncoloured.

[neovim] quickfix window steals focus when it opens

Actual behavior

On neovim-0.2.0 (latest release), if you save a file with errors, when the quickfix window appears it is focused. It's irritating to have to constantly move back to the pane I was working in when there are errors.

Expected behavior

The quickfix window should appear and not be focused (or this should be configurable).

Steps to reproduce

Empty rcfile with only vim-hack installed. Save a php file with an error in it. (Note that this only happens when the quickfix window is first opened, subsequent saves don't do anything).

When tested in vim-7.4 I get the expected behavior.

Configuration

neovim version: 0.2.0
vim version: 7.4

Remote typechecking

Hey there,

A key feature (while HHVM is broken on OS X) that would make Hack so much easier to work with is to take advantage of the client-server architecture the typechecker has.

Currently, I run HHVM in a Docker container (in a Boot2Docker VM) on an OS X host, and this works well enough (I can run the type checker through ssh and get the output in the console). It would be amazing if vim-hack could do the same: give it an SSH command that it will execute it's calls to hh_client/hh_server through.

Is this possible through Vim? I'm honestly unsure.

Window pops up breifly

Sometimes when I save, the window at the bottom pops up very quickly, then immediately goes away and leaves me in a state of off-by-one in the parts that haven't redrawn yet. Doing a :redraw! fixes it or scrolling the code out of view and then back works too.

Completion works only at the end of line

If you try calling hackcomplete while in the middle of a line (e.g. for editing parameters in an existing function call), the completion fails. After digging a bit, it seems, that the character under the cursor gets appended to the hh_client call before the magic autocomplete token.

public function morty(): string {
        return 'morty';
} 

public function rick(): void {
        json_encode($this->m);
}

Trying to complete $this->m (having the cursor pointing at the )) will fail, the string passed to hh_client looks like json_encode($this->)mAUTO332; If you remove the trailing );, the completion will work as expected.

Imho, it should more look like json_encode($this->mAUTO332); which correctly completes to $this->morty.

I'm not very experienced in vimscript, but I have a solution and will create a pr.

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.