Skip to content

Commit 4be8b70

Browse files
Merge branch 'getgauge:master' into master
2 parents ffea10b + db9f3ef commit 4be8b70

File tree

22 files changed

+640
-358
lines changed

22 files changed

+640
-358
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
shell: powershell
4747
run: |
4848
Start-Sleep -Milliseconds 1
49-
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
50-
Invoke-WebRequest "https://sourceforge.net/projects/nsis/files/NSIS%203/3.06.1/nsis-3.06.1-strlen_8192.zip/download" -UseBasicParsing -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome -Outfile "./nsis.zip"
49+
Invoke-WebRequest "https://sourceforge.net/projects/nsis/files/NSIS%203/3.10/nsis-3.10-strlen_8192.zip/download" -UserAgent "PowerShell" -Outfile "./nsis.zip"
5150
Expand-Archive -Force -LiteralPath ./nsis.zip -DestinationPath "C:\Program Files (x86)\NSIS\"
5251
5352
- name: Compile gauge
@@ -242,33 +241,3 @@ jobs:
242241
cd gauge
243242
./package.ps1
244243
choco push "gauge.$Env:GAUGE_VERSION.nupkg" --apikey=$Env:API_KEY --source=https://push.chocolatey.org/
245-
246-
brew-release:
247-
runs-on: ubuntu-latest
248-
needs: [gauge-version]
249-
steps:
250-
- uses: actions/checkout@v4
251-
- run: git fetch --prune --unshallow
252-
253-
- name: Set up Ruby
254-
uses: ruby/setup-ruby@v1
255-
with:
256-
ruby-version: 3.3
257-
258-
- name: Fetch gauge version
259-
uses: actions/download-artifact@v4
260-
with:
261-
name: gauge-version
262-
path: .
263-
264-
- name: Set gauge version
265-
run: echo "GAUGE_VERSION=`cat version.txt`" >> $GITHUB_ENV
266-
267-
- name: Update brew formula
268-
env:
269-
HOMEBREW_GITHUB_USER_NAME: ${{ secrets.HOMEBREW_GITHUB_USER_NAME }}
270-
HOMEBREW_GITHUB_USER_EMAIL: ${{ secrets.HOMEBREW_GITHUB_USER_EMAIL }}
271-
GITHUB_TOKEN: ${{ secrets.GAUGEBOT_GITHUB_TOKEN }}
272-
run: |
273-
cd build/brew
274-
bash create_brew_pr.sh

api/lang/completionStep.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ func allImplementedStepValues() ([]gauge.StepValue, error) {
6565
return stepValues, fmt.Errorf("failed to get steps from runner. %s", err.Error())
6666
}
6767
for _, stepText := range res.GetSteps() {
68-
stepValue, _ := parser.ExtractStepValueAndParams(stepText, false)
69-
stepValues = append(stepValues, *stepValue)
68+
stepValue, err := parser.ExtractStepValueAndParams(stepText, false)
69+
if err != nil {
70+
logError(nil, "Unable to extract StepValueAndParams for step '%s', error : %s", stepText, err.Error())
71+
} else {
72+
stepValues = append(stepValues, *stepValue)
73+
}
7074
}
7175
return stepValues, nil
7276
}

api/lang/format.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ func format(request *jsonrpc2.Request) (interface{}, error) {
3838
oldString := getContent(params.TextDocument.URI)
3939
textEdit := createTextEdit(newString, 0, 0, len(strings.Split(oldString, "\n")), len(oldString))
4040
return []lsp.TextEdit{textEdit}, nil
41+
} else if util.IsValidConceptExtension(file) {
42+
conceptsDictionary := gauge.NewConceptDictionary()
43+
_, parseErrs, err := parser.AddConcepts([]string{file}, conceptsDictionary)
44+
if err != nil {
45+
return nil, err
46+
}
47+
if parseErrs != nil {
48+
return nil, fmt.Errorf("failed to format document. Fix all the problems first")
49+
}
50+
conceptMap := formatter.FormatConcepts(conceptsDictionary)
51+
newString := conceptMap[file]
52+
oldString := getContent(params.TextDocument.URI)
53+
textEdit := createTextEdit(newString, 0, 0, len(strings.Split(oldString, "\n")), len(oldString))
54+
return []lsp.TextEdit{textEdit}, nil
4155
}
42-
return nil, fmt.Errorf("failed to format document. %s is not a valid spec file", file)
56+
return nil, fmt.Errorf("failed to format document. %s is not a valid spec/cpt file", file)
4357
}

api/lang/server.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/getgauge/gauge/api/infoGatherer"
1919
"github.com/getgauge/gauge/execution"
2020
"github.com/getgauge/gauge/gauge"
21+
"github.com/getgauge/gauge/config"
2122
"github.com/sourcegraph/jsonrpc2"
2223
)
2324

@@ -183,6 +184,17 @@ func (h *LangHandler) Handle(ctx context.Context, conn jsonrpc2.JSONRPC2, req *j
183184
logDebug(req, err.Error())
184185
}
185186
return val, err
187+
case "workspace/didChangeConfiguration":
188+
err := config.UpdateSettings(req)
189+
if err != nil {
190+
logDebug(req, err.Error())
191+
e := showErrorMessageOnClient(ctx, conn, err)
192+
if e != nil {
193+
return nil, fmt.Errorf("unable to send '%s' error to LSP server. %s", err.Error(), e.Error())
194+
}
195+
}
196+
logDebug(req, "Updated settings.")
197+
return nil, err
186198
case "gauge/stepReferences":
187199
val, err := stepReferences(req)
188200
if err != nil {

build/brew/brew_update.rb

Lines changed: 0 additions & 61 deletions
This file was deleted.

build/brew/create_brew_pr.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)