GithubHelp home page GithubHelp logo

lvxingtu / ijaas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from draftcode/ijaas

0.0 1.0 0.0 106 KB

Make IntelliJ as a Java server that does autocompletion for Vim.

License: Apache License 2.0

Java 81.44% Vim Script 18.56%

ijaas's Introduction

IntelliJ as a Service

Make IntelliJ as a Java server that does autocompletion for Vim.

This is not an official Google product (i.e. a 20% project).

Installation

  1. git clone.
  2. Import project into IntelliJ. Use Gradle plugin.
  3. Run gradle buildPlugin. It creates build/distributions/ijaas-*.zip at the git root dir. (You can pass -Pintellij.version=IC-2017.2.6 to specify the IntelliJ version.)
  4. Select "File" menu and click "Settings...". In "Plugins" menu, click "Install plugin from disk..." button. Choose ijaas-*.zip. You can uninstall this plugin from this menu.
  5. Restart IntelliJ.
  6. Add "vim" directory to your runtimepath in Vim in your own way. (e.g. Plug "$HOME/src/ijaas/vim").

Development

If you want to isolate your development version and the current version, you might need two clones. You can load Vim plugins conditionally by using environment variables.

if !exists('$USE_DEV_IJAAS')
  Plug '$HOME/src/ijaas-dev/vim'
else
  Plug '$HOME/src/ijaas/vim'
endif

You can start another IntelliJ instance by using gradle runIdea. You can pass -Dijaas.port=5801 to make the testing IntelliJ process listen on a different port (see JetBrains/intellij-platform-gradle-plugin#18). Connect to the testing IntelliJ with USE_DEV_IJAAS=1 IJAAS_PORT=5801 vim. The ijaas vim plugin will recognize IJAAS_PORT and use that to connect to the ijaas IntelliJ plugin.

Using with ALE

You can define an ALE linter.

# Disable buf_write_post. Files are checked by ALE.
let g:ijaas_disable_buf_write_post = 1

# Define ijaas linter.
function! s:ijaas_handle(buffer, lines) abort
  let l:response = json_decode(join(a:lines, '\n'))[1]
  if has_key(l:response, 'error') || has_key(l:response, 'cause')
    return [{
          \  'lnum': 1,
          \  'text': 'ijaas: RPC error: error=' . l:response['error']
          \    . ' cause=' . l:response['cause'],
          \}]
  endif

  return l:response['result']['problems']
endfunction
call ale#linter#Define('java', {
      \   'name': 'ijaas',
      \   'executable': 'nc',
      \   'command': "echo '[0, {\"method\": \"java_src_update\", \"params\": {\"file\": \"%s\"}}]' | nc localhost 5800 -N",
      \   'lint_file': 1,
      \   'callback': function('s:ijaas_handle'),
      \ })

ijaas's People

Contributors

draftcode avatar mattn avatar restartr avatar

Watchers

James Cloos avatar

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.