Skip to content

Commit

Permalink
chore: temporarily use other tree-sitter-php that fixes tree-sitter-b…
Browse files Browse the repository at this point in the history
…ash conflicts
  • Loading branch information
kkoomen committed Jul 8, 2023
1 parent 49dfa86 commit 09f51b2
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 38 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ jobs:
run: ./scripts/build.sh "${{ matrix.settings.target }}" "${{ matrix.settings.asset_path }}"
shell: bash

- name: Set output
id: vars
run: echo ::set-output name=app_version::${GITHUB_REF#refs/heads/release/}

- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
tag_name: ${{ steps.vars.outputs.app_version }}
tag_name: ${GITHUB_REF#refs/heads/release/}
files: ./bin/${{ matrix.settings.asset_path }}.tar.gz
draft: false
prerelease: true
2 changes: 1 addition & 1 deletion ftplugin/sh.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set cpoptions&vim
let b:doge_parser = 'bash'
let b:doge_insert = 'above'

let b:doge_supported_doc_standards = 'google'
let b:doge_supported_doc_standards = ['google']
let b:doge_doc_standard = doge#buffer#get_doc_standard('sh')

let &cpoptions = s:save_cpo
Expand Down
2 changes: 1 addition & 1 deletion helper/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ serde = { version = "1.0.104", features = ["derive"] }
serde_json = "1.0.99"
serde_yaml = "0.9.22"
tree-sitter = "0.20.10"
tree-sitter-php = { git = "https://github.com/tree-sitter/tree-sitter-php" }
tree-sitter-php = { git = "https://github.com/amaanq/tree-sitter-php", branch = "fix-conflicts" }
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash" }
tree-sitter-lua = { git = "https://github.com/Azganoth/tree-sitter-lua" }
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby" }
Expand Down
4 changes: 2 additions & 2 deletions helper/src/docblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::config::load_doc_config_str;
use crate::tokens::replace_tokens;
use crate::base_parser::BaseParser;

// use crate::bash::parser::BashParser;
use crate::bash::parser::BashParser;
use crate::c::parser::CParser;
use crate::cpp::parser::CppParser;
use crate::csharp::parser::CSharpParser;
Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn generate(

let parser: Box<dyn BaseParser> = match parser_name {
"php" => Box::new(PhpParser::new(code, line, &node_types, options)) as Box<dyn BaseParser>,
// "bash" => Box::new(BashParser::new(code, line, &node_types)) as Box<dyn BaseParser>,
"bash" => Box::new(BashParser::new(code, line, &node_types)) as Box<dyn BaseParser>,
"lua" => Box::new(LuaParser::new(code, line, &node_types)) as Box<dyn BaseParser>,
"ruby" => Box::new(RubyParser::new(code, line, &node_types)) as Box<dyn BaseParser>,
"rust" => Box::new(RustParser::new(code, line, &node_types)) as Box<dyn BaseParser>,
Expand Down
4 changes: 2 additions & 2 deletions helper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pub mod config;
pub mod docblock;
pub mod base_parser;

pub mod bash;
pub mod php;
pub mod lua;
pub mod ruby;
pub mod rust;
Expand All @@ -13,5 +15,3 @@ pub mod python;
pub mod c;
pub mod cpp;
pub mod typescript;
pub mod php;
// pub mod bash;
94 changes: 68 additions & 26 deletions test/filetypes/sh/functions.vader
Original file line number Diff line number Diff line change
@@ -1,26 +1,68 @@
" # ==============================================================================
" # Regular functions.
" # ==============================================================================
" Given sh (regular functions):
" function test {
" echo "foobar"
" }
"
" Do (trigger doge):
" \<C-d>
"
" Expect sh (generated comments with a descriptios and 'Globals', 'Arguments' and 'Returns' keywords):
" ################################################################################
" # [TODO:description]
" # Globals:
" # [TODO:variable name]
" # Arguments:
" # $1: [TODO:description for each parameter]
" # Outputs:
" # [TODO:description for each output variable]
" # Returns:
" # [TODO:description]
" ################################################################################
" function test {
" echo "foobar"
" }
# ==============================================================================
# Regular functions.
# ==============================================================================
Given sh (regular functions):
function foo {
echo "foo"
}

function bar() {
echo "bar"
}

baz() {
echo "baz"
}

Do (trigger doge):
\<C-d>
:16\<CR>
\<C-d>
:31\<CR>
\<C-d>

Expect sh (generated comments with a descriptios and 'Globals', 'Arguments' and 'Returns' keywords):
################################################################################
# [TODO:description]
# Globals:
# [TODO:variable name]
# Arguments:
# $1: [TODO:description for each parameter]
# Outputs:
# [TODO:description for each output variable]
# Returns:
# [TODO:description]
################################################################################
function foo {
echo "foo"
}

################################################################################
# [TODO:description]
# Globals:
# [TODO:variable name]
# Arguments:
# $1: [TODO:description for each parameter]
# Outputs:
# [TODO:description for each output variable]
# Returns:
# [TODO:description]
################################################################################
function bar() {
echo "bar"
}

################################################################################
# [TODO:description]
# Globals:
# [TODO:variable name]
# Arguments:
# $1: [TODO:description for each parameter]
# Outputs:
# [TODO:description for each output variable]
# Returns:
# [TODO:description]
################################################################################
baz() {
echo "baz"
}

0 comments on commit 09f51b2

Please sign in to comment.