Giter VIP home page Giter VIP logo

Comments (5)

toshi0383 avatar toshi0383 commented on May 22, 2024 1

Confirmed fix at master. 👍

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 22, 2024

I pushed a fix to master, would you mind taking a look whether it works for your codebase?
The commit with changes

Edit: according to @jpsim, treating key.offset / length as byteOffset is correct, so my fix of using that as characterOffset even if it passes sounds like a wrong approach.
Need to take a look at this again and see if there is anything there that we might be doing wrong, or is this sourcekitten bug and in that case fill a report for them

from sourcery.

jpsim avatar jpsim commented on May 22, 2024

Yeah, this is likely a bug in SourceKitten, and likely the same issue as realm/SwiftLint#1006.

We're investigating the following re-implementation, but since that breaks other things we haven't fully determined the scope of this issue:

func lineAndCharacter(forByteOffset offset: Int) -> (line: Int, character: Int)? {
    let characterOffset = location(fromByteOffset: offset)
    return lineAndCharacter(forCharacterOffset: characterOffset)
}

from sourcery.

jpsim avatar jpsim commented on May 22, 2024

And to reiterate from twitter, yes all offsets and lengths reported by SourceKit are in bytes.

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 22, 2024

ok I think the master is working now, I used the suggestion for translating the byteOffset, once sourcekitten solves the internal issue we can go back to using old function. @toshi0383 can you confirm current master works for you? I added test but just to be sure

from sourcery.

Related Issues (20)

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.