Skip to content

Commit

Permalink
Merge pull request #81 from steelbrain/bug-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Jun 15, 2021
2 parents 20eb52b + 24bb17f commit c6fd7d8
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"no-duplicate-imports": 0,
"flowtype/no-types-missing-file-annotation": 1,
"react/no-string-refs": 1,
"prefer-destructuring": 1
"prefer-destructuring": 1,
"react/destructuring-assignment": "off"
},
"globals": {
"atom": "readonly"
Expand Down
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ decls

[options]
module.system=node
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
30 changes: 26 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,36 @@ jobs:
channel: ${{ matrix.atom_channel }}

- name: Install dependencies
run: |
apm install
run: apm install

- name: Run tests 👩🏾‍💻
run: npm run test

Lint:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Commit lint ✨
uses: wagoid/commitlint-github-action@v2

- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: 6

- name: Install dependencies
run: pnpm install --frozen-lockfile

# - name: Format ✨
# run: pnpm run test.format

- name: Flow
run: npm run test.flow
run: pnpm run test.flow

- name: Lint
run: npm run test.lint
run: pnpm run test.lint
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Intentions
=========

[![CI](https://github.com/steelbrain/intentions/actions/workflows/CI.yml/badge.svg)](https://github.com/steelbrain/intentions/actions/workflows/CI.yml)

Intentions is a base package that provides an easy-to-use API to show intentions based in Atom.

#### Usage
Expand Down
7 changes: 2 additions & 5 deletions lib/providers-highlight.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* @flow */

import { Range } from "atom"
import type { TextEditor } from "atom"
import { provider as validateProvider, suggestionsShow as validateSuggestions } from "./validate"
import { create as createElement, PADDING_CHARACTER } from "./elements/highlight"
Expand Down Expand Up @@ -39,10 +38,8 @@ export default class ProvidersHighlight {
const scopes = textEditor.scopeDescriptorForBufferPosition(bufferPosition).getScopesArray()
scopes.push("*")

const visibleRange = Range.fromObject([
textEditor.bufferPositionForScreenPosition([textEditor.getFirstVisibleScreenRow(), 0]),
textEditor.bufferPositionForScreenPosition([textEditor.getLastVisibleScreenRow(), 0])
])
const visibleRange = { ...textEditor.getBuffer().getRange() }

// Setting this to infinity on purpose, cause the buffer position just marks visible column
// according to element width
visibleRange.end.column = Infinity
Expand Down
2 changes: 1 addition & 1 deletion lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Point, Range, TextEditor, TextEditorMarker } from "atom"

export type ListItem = {
// Automatically added
__$sb_intentions_class: string,
__$sb_intentions_class?: string,

// From providers
icon?: string,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"vanilla-jsx": "^3.0.2"
},
"devDependencies": {
"eslint-config-steelbrain": "^7",
"flow-bin": "^0.130.0",
"eslint-config-steelbrain": "7",
"flow-bin": "0.130.0",
"jasmine-fix": "^1.3.1",
"@types/atom": "latest"
},
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

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

3 changes: 2 additions & 1 deletion spec/helpers-spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* @flow */

import * as Helpers from "../lib/helpers"
import type { ListItem } from "../lib/types"

describe("Helpers", function() {
describe("processListItems", function() {
it("works", function() {
let suggestions: Array<Record<string, any>> = [
let suggestions: Array<ListItem> = [
{
priority: 100,
title: "title 1",
Expand Down

0 comments on commit c6fd7d8

Please sign in to comment.