Coder Social home page Coder Social logo

swiftsemantics's People

Contributors

chriseidhof avatar compnerd avatar literalpie avatar lukas-stuehrk avatar lutzifer avatar mattt avatar maxdesiatov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftsemantics's Issues

`typeAnnotation` is nil for type inference

Problem

I found typeAnnotation is nil when a variable is declared with type inference

Example

func makeSession() -> Session

class MediaPlayer {
     let session = makeSession()
}

result:

name: session, typeAnnotation: nil

expected result

name: session, typeAnnotation: Session

I think this might be an issue in SwiftSyntax, but I am not sure if this is by design.

Can't use `Protocol`

image

I was able to use [Class], [Structure] but not [Protocol] or [SwiftSemantics.Protocol] for some reason, any idea will be appreciated

TypeAnnotation is empty for inferred types

when parsing symbols, variables with inferred types don't get a typeAnnotation.

class SomeClass {
    let scheduler = DispatchQueue.global(qos: .background)
}

See printout below of a symbol as Variable result: typeAnnotation is nil

▿ let scheduler = DispatchQueue.global(qos: .background)
  - attributes : 0 elements
  ▿ modifiers : 1 element
    ▿ 0 : private
      - name : "private"
      - detail : nil
  - keyword : "let"
  - name : "scheduler"
  - typeAnnotation : nil
  ▿ initializedValue : Optional<String>
    - some : "DispatchQueue.global(qos: .userInitiated)"
  - accessors : 0 elements

Is this intentional to only show explicit types?

When setting an explicit type it works fine:

class SomeClass {
    let scheduler: DispatchQueue  = .global(qos: .background)
}

Example doesn't run from Xcode

If you create a new swift package, open it in Xcode, and add the dependencies and sample code, it fails to run successfully:

dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
  Referenced from: /Users/chris/Library/Developer/Xcode/DerivedData/swiftmodulevis-dsdxeurkiqwybuaykcssnhgivnum/Build/Products/Debug/swiftmodulevis
  Reason: image not found

I forgot what causes this bug. Running/building from the terminal works fine. Maybe good to either add a notice or fix this? (I don't have time but wanted to let you know anyway).

This is Xcode 11.3 on Mojave.

Problem bumping to 0.3.2

Hi,

First, thanks for this library which saved me days learning SwiftSyntax 😁

Second, I am having a problem updating SwiftSemantics from version 0.2.0 to 0.3.2 in my project's Package.swift

The error shown in XCode is

Dependencies could not be resolved because root depends on 'SwiftSemantics' 0.3.2..<1.0.0.
'SwiftSemantics' >= 0.3.2 cannot be used because no versions of 'SwiftSemantics' match the requirement 0.3.3..<1.0.0 and package 'swiftsemantics' is required using a stable-version but 'swiftsemantics' depends on an unstable-version package 'swift-syntax'.

Has anyone encountered this problem ?
Thanks 

My Package.swiftfile is:

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "ModelGenerator",
    platforms: [ .macOS(.v10_15) ],
    products: [
        .executable(name: "ModelGenerator", targets: ["ModelGenerator"])
    ],
    dependencies: [
        .package(
            url: "https://github.com/apple/swift-argument-parser",
            from: "0.4.3"
        ),
        .package(
            name: "SwiftSemantics",
            url: "https://github.com/SwiftDocOrg/SwiftSemantics",
            from: "0.3.2"
        ),
    ],
    targets: [
        .target(
            name: "ModelGenerator",
            dependencies: [
                "ModelGeneratorCore",
                .product(name: "ArgumentParser", package: "swift-argument-parser"),
            ]
        ),
        .target(
            name: "ModelGeneratorCore",
            dependencies: [
                "SwiftSemantics",
            ]
        )
    ]
)

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.